This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Sam
Sam

Hi,

I need to have a text only version of the website, but october can only have one active theme. I thought of creating a new layout with just the elements needed but how do I assign that layout when calling the pages? Any ideas on a good solution for a text only version of the site?

Ilesyt
Ilesyt

Set the layout of the page to the layout you need.

daftspunky
daftspunky

You can use environment variables to change the theme (cms.activeTheme config) based on a hostname or some other web server configuration.

jan-vince
jan-vince

Or if you are building your layout up from partials, you can call them with environment name:

description = "Universal layout"
==
<?php
function onStart() {
// Some logic to switch between 'text' and 'full' (or other)
 $this['siteMode'] = 'text'; 
}
?>
==
...
{% partial 'my-content-' ~ siteMode %}
...

So you can create partials:

  • my-content-text.htm
  • my-conent-full.htm

But this is just an idea out of my head. You have to test it.

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.