Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Display content based on template

Quote Reply
Display content based on template
Hi, I'm trying to do something very simple, which is to display premium ads on my home page and other ads on the rest of the pages. I can't seem to find the correct syntax, but an illustration of what I'm trying to do is below:

<%if $template == 'home.html'%>
code to display home page ads
<%else%>
code to display other ads
<%endif%>

Anyone know this off the top of your head?


Jack R.
http://www.aeroseek.com/
Quote Reply
Re: [aeroseek] Display content based on template In reply to
Code:
<%if page_id eq 'home'%>
...
<%else%>
...
<%endif%>

Adrian

Last edited by:

brewt: Feb 3, 2006, 7:39 PM
Quote Reply
Re: [brewt] Display content based on template In reply to
Hmm...didn't work Unsure
Maybe I didn't explain it well enough. I'm trying to insert some ads into include_leftsidebar.html template. If the template is called on the 'home' page, I want to display premium ads. If it's on other pages, display other ads. The above code still displays the same thing on all pages. BTW, I'm testing this using Dynamic mode.
Jack R.
http://www.aeroseek.com/
Quote Reply
Re: [aeroseek] Display content based on template In reply to
Oops, that should be "page_id eq 'home'"

Adrian

Last edited by:

brewt: Feb 3, 2006, 8:53 PM
Quote Reply
Re: [brewt] Display content based on template In reply to
Sweeeet!Cool This is what finally worked:
Code:
<%if page_id eq 'home'%>
...
<%else%>
...
<%endif%>
Stupid me...I was using '==' instead of 'eq'.

Thank you so much!
Jack R.
http://www.aeroseek.com/

Last edited by:

aeroseek: Feb 3, 2006, 7:50 PM