use of variables in page template

Author Message

Rinze Cats

Monday 29 March 2004 8:22:32 am

Hiya,

i am new to ez puslish and I can't figure out the following problem:

I want to change the way my page behaves depeding on the section it is in. In my page template I added code the get the section id and set a string.

{* set style selection string *}
{let varID=$DesignKeys:used['section'] varStyle='style1'}

{switch match=$#varID}
{case match=6}
{set varStyle='style6'}
{/case}
{case match=5}
{set varStyle='style5'}
{/case}
{case default}
{set varStyle='no style found'}
{/case}
{/switch}
{/let}

I want to use the varStyle variable in my html tags to define the classes it should use
for instance: <td class={$varStyle}></td>

What is the correct way to do it. Variables only seem to be available within the 'let' tags?

all help and pointers are very much appreciated!

greetz
rinze

Alex Jones

Tuesday 30 March 2004 6:48:18 am

Try removing the # from your match statement. Otherwise that should work.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Rinze Cats

Wednesday 31 March 2004 4:13:17 am

thanx for the reply, i'll try your suggestion!

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