is there a possibily of inserting php code in tpl

Author Message

M Farhan

Wednesday 11 June 2003 11:52:55 pm

Hello Everyone,

I need to place in some logic (like if then else) in my tpl code, is there a possibility of doing such a thing??

Thanks in advance

MF

Paul Forsyth

Thursday 12 June 2003 12:13:03 am

You can build a if-then-else with template functions:

{section show=eq($val, 1)}
do something
{section-else}
do something else
{/section}

if you want to test further you can either use a switch statement or embed further sections:

{section show=eq($val, 1)}
do something
{section-else}

{section show=eq($val, 2)}
do more
{section-else}
do even more
{/section}

{/section}

you dont need to resort to php for just this type of logic.

paul

Esben Maaløe

Sunday 22 June 2003 7:28:03 am

> you dont need to resort to php for just this type of logic

Hehehe - I really wish you COULD 'resort' to php :)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.