[Templates] Newbie question about setting site wide variables

David Favor david at davidfavor.com
Mon Apr 28 23:48:24 BST 2008


Andy Wardley wrote:
> David Favor wrote:
>> I'm trying to set a site wide dynamic variable date similar to:
>>
>>     [%
>>        email     = 'someone at somewhere.com'
>>        this_year = [% date.format(date.now,'%Y') %]
>                      ^^                            ^^
> You've got an extra set of [% %] that you don't need.
> 
>    [%
>       email     = 'someone at somewhere.com'
>       this_year = date.format(date.now,'%Y')
>    %]
> 
> That should do it.  Just don't forget to [% USE date %] somewhere
> above that line to load the date plugin.
> 
> A
> 
> 
> 

The following did the trick. Thanks!

_______


[% USE date %]

[%
    thisyear = date.format(date.now,'%Y')
%]


-- 
Love feeling your best ever, all day, every day?
Click http://RadicalHealth.com for the easy way.



More information about the templates mailing list