Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hey,

Possibly a quick one. A client of mine has requested the ability to change the hompage in the event of an incident at work. Such as instead of having the home page with the navigation and basic visuals, they want the company logo and some text which they can enter via Couch.

This is very simple in HTML, however my client is computer illiterate and can just about use the Couch system. Is there a way I can have an action within the Couch control panel that the user can select an option which will allow only one page to be visible / accessible and vice versa?

Thanks in advance
Hi and welcome Aran :)

There can be several ways of pulling this off.
One could be as follows -

Create a template (non-clonable, non-executable) named 'temp_homepage.php' and define two editable regions within it -
a. A checkbox named 'use_temp'
b. A richtext named 'temp_content'

Now modify your original homepage to make it something like this -
Code: Select all
<cms:if "<cms:get_custom_field 'use_temp' masterpage='temp_homepage.php' />" >
    <cms:get_custom_field 'temp_content' masterpage='temp_homepage.php' />
<cms:else />
    .. your normal homepage contents here ..
</cms:if>

Basically, in the code above we first check if the 'use_temp' setting has been set by client in 'temp_homepage.php'. If it is, we show the contents within 'temp_content' (you may format it to your liking). Else, show the normal contents.

So the client simply has to tick the checkbox to switch to the temporary homepage.

Hope this helps.
Hi KK, thank you for the swift reply!

Correct me if I'm wrong, but won't this give any visitor who stumbles across this page the ability to switch between the home pages? I need something secure within Couch that the client would have to log into to switch between the pages.

Please correct me if i've misunderstood your answer.

Thanks again
Aran,

The checkbox that flips between the homepages is actually an editable region and can be set/unset only from within the admin-panel. So, rest assured, only an admin would be able to access it.

Hope that clears up the doubt.
Thank you KK, that is exactly what I am looking for.

Very much appreciated!
5 posts Page 1 of 1
cron