Share » Forums » Setup & design » Different image as top

Different image as top

Different image as top

Monday 18 October 2004 6:50:00 am - 3 replies

Modified on Monday 18 October 2004 6:52:54 am by Siw Helen Thorslund

Author Message

Tobias Persson

Monday 18 October 2004 7:54:25 am

There are no 'if' in the template language. Use section and show instead.

{section show=$module_result.path[1].node_id|eq(111)}
   image 1

{section-else} 

   image 2

{/section}

Marco Zinn

Monday 18 October 2004 12:57:38 pm

Tobias is right. There is no "if" ("There is no spoon")
If you want to switch more than two images, you may want to have a look at the swich-case constructor.
We used this in a very similar case, but i don't have access to the template code at the moment.
Don't forget the fallback/default case, if you use "switch".

Marco
http://www.hyperroad-design.com

Vjeran Vlahovic

Tuesday 26 October 2004 11:07:37 am

I did it this way:

<div id="page-header2" {switch name=kategorija match=$module_result.path[1].node_id}
{case match='101'}
style="background: transparent url(/design/testing/images/background-header2.jpg) no-repeat;"
{/case}
{case match='108'}
style="background: transparent url(/design/testing/images/background-header6.jpg) no-repeat;"
{/case}
{case match='103'}
style="background: transparent url(/design/testing/images/header4.jpg) no-repeat;"
{/case}
{case}
style="background: transparent url(/design/testing/images/header5.jpg) no-repeat;"
{/case}
{/switch}>

http://www.netgen.hr/eng

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu