"if then" statement

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
DDDooGGG

"if then" statement

Post 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.
cyberman

Re: "if then" statement

Post 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}
SimonSchaufi

Re: "if then" statement

Post by SimonSchaufi »

It is even possible like this:

Last edited by SimonSchaufi on Sun Jun 10, 2007 3:42 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: "if then" statement

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “CMSMS Core”