Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How do I tell what template I am at?

Quote Reply
How do I tell what template I am at?
Hello,
I want to say:

if (template == home.html)
include_right_side.html;
if (template == category.html)
do not include_right_side.html;
if (template == cool.html)
include_right_side.html;
if (template == search.html)
do not include_right_side.html
else
include_right_side.html
endif;

how do i translate this code to perl/cgi to work in static mode in my code.
Thanks
Makr
Quote Reply
Re: [Mark2] How do I tell what template I am at? In reply to
Well going off your example above it would be simpler to just remove <%include include_rightsidebar.html%> from the templates that you don't want it to appear in.
Quote Reply
Re: [MJB] How do I tell what template I am at? In reply to
Well! that was just an example; however, I have a compex logic to integrate based on the template name... so I was just wondering how in the code will you be able to put "if" statement... or in a common file like accessability header ... to tell which page it is: cool, new, home, search...etc...
because I have 10 sections in the rightside page, that I load few of them based on page name (home, search, rate...etc.).. and other section based on different page names:


Thanks in advance...
Mark
Quote Reply
Re: [Mark2] How do I tell what template I am at? In reply to
This any good?

<%if page_id eq 'home'%>Display sidebar 1<%else%>Display sidebar 2<%endif%>

<%if page_id eq 'category'%>Display sidebar 2<%else%>Display sidebar 1<%endif%>

More info in this thread.
Quote Reply
Re: [MJB] How do I tell what template I am at? In reply to
Thanks much.. this is exactely what I am looking for..