Page 1 of 1

"if then" statement

Posted: Thu May 10, 2007 3:50 am
by DDDooGGG
OK, i have CMSMS installed and it runs seamlessly and am very, very happy with it.  I just have 1 question at the moment.
Is it possible to make an "if then" statment in a template, like below?

Code: Select all

if ($_GET['page'] == 'release'){
    $header_img = 'release.jpg';
} else if { ($_GET['page'] == 'home'){
    $header_img = 'home.jpg';
}
thanks in advance;)

Fult.

Re: "if then" statement

Posted: Thu May 10, 2007 7:26 am
by cyberman
By default Smarty knows value of page variable too. So it should be possible to realize a different, page dependingly header image in that smarty way
{if $page == 'release'}
 
{elseif $page == 'home'}
 
{endif}

Re: "if then" statement

Posted: Sat Jun 09, 2007 2:40 pm
by SimonSchaufi
It is even possible like this:


Re: "if then" statement

Posted: Sun Jun 10, 2007 12:12 am
by calguy1000
try:

Code: Select all

<img src="uploads/images/{$page_alias}.jpg">
Where page alias is the text (either automatically supplied, or that you typed, in the page alias field in the options tab when editing content.