Page 1 of 1

change multiple content in one go

Posted: Tue Jan 19, 2010 2:43 pm
by Mads Rasmussen
Hi
Newbee!!!
I'm not sure of this is the correct part of the forum to put my question and I'm sure this has been asked before, only I can't find the answer, but I'll give it a go any how.

I have a three column layout.
The header has two images, one (the upper) has to stay all the time and one (lower) has to be changed according to the pages content.
I have a main menu in the right column and a local menu in the left column, this has to be changed according to the pages content.
the local menu I can change by creating a template for this specific catagory. But it would be so nice to be able to change the image and local menu in one go.

So the simple question is, how do I that?

:-)

Mads

Re: change multiple content in one go

Posted: Tue Jan 19, 2010 6:37 pm
by jmcgin51
if I understand what you're looking for, there are several ways to do this.

something like

{if $page_alias == 'home'}

{elseif $page_alias == 'about'}

etc
{/if}

The menu can be dynamic as well, based on the page that is currently displayed.

Re: change multiple content in one go

Posted: Thu Jan 21, 2010 12:56 pm
by Mads Rasmussen
Hi  jmcgin51
Thank you for responding.

I found this, similar to your piece of code.:

Code: Select all

global $gCms;
$thispage = "";
$thispage = $gCms->variables['page_name'];
if ($thispage == "pagename")  echo "this is for pagename";
elseif  ($thispage == "othername") echo "this is for othername";
elseif  ($thispage == "npage") echo "you can have as many elseif clauses you want";
else echo "default text";
seems to work just fine.
also it seems to be a bit culmsy, but what the heck :-) it works.

I assume that I can do the very same thing with the menu as well.

:-)

Mads