[PHPTAL] Simple question from a TAL newbie.
Laurent Bedubourg
lbedubourg at motion-twin.com
Wed Jan 24 09:39:55 CET 2007
Brian Peiris wrote:
> The code below shows my very first attempt at using TAL. It took me
> quite a while to get to this point, and it still seems wrong.
> Basically if the "titleSuffix" variable is set in the php code, the
> page title should display:
> "My Website - Test Page"
> and if "titleSuffix" is not set (i.e. that line is commented out), the
> title should display:
> "My Website"
> However it seems redundant and messy to have two <title> tags in the
> template, is there a better (cleaner) way of achieving the same
> result?
> Thanks,
> Brian.
>
Hi Brian,
Try something like this :
<title>
My website
<span
tal:condition="exists mySubTitle"
tal:replace="string:- $mySubTitle"
/>
</title>
Regards
--
Laurent Bedubourg
lbedubourg at motion-twin.com
http://www.motion-twin.com
More information about the PHPTAL
mailing list