PDA

View Full Version : Stuck....?



skshost
03-19-07, 09:44 PM
In header.tpl


{php}
if ( $thisPage == 'supporthome' ) {
echo "<span class=currentpage>SUPPORT</span>.";
} else {
echo "<a href=http://my.hostdomain.com/>SUPPORT</a>.";
}
{/php}


In homepage.tpl


{php}
$thisPage = 'supporthome';
{/php}


It's not working, I'm guessing that I need to pass the variable through smarty?

skshost
03-22-07, 01:58 AM
???

generic
03-22-07, 04:05 AM
maybe because the header is coming before the home page template so the variable is not set until after your doing your comparison..

skshost
03-22-07, 09:40 PM
Any ideas how I could accomplish this?

Matt
03-22-07, 11:52 PM
Why not use the {$pagetitle} variable that is already available on all pages in your IF statement? Something like {if $pagetitle eq "Support"}do this{/if}

Matt

skshost
03-28-07, 10:54 PM
Thanks Matt, that was much easier.