change multiple content in one go

General project discussion. NOT for help questions.
Post Reply
Mads Rasmussen
Forum Members
Forum Members
Posts: 19
Joined: Thu Jan 14, 2010 5:25 pm

change multiple content in one go

Post 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
Attachments
SafariScreenSnapz001.jpg
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: change multiple content in one go

Post 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.
Mads Rasmussen
Forum Members
Forum Members
Posts: 19
Joined: Thu Jan 14, 2010 5:25 pm

Re: change multiple content in one go

Post 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
Post Reply

Return to “General Discussion”