Forums / Setup & design / Different image as top
Siw Helen Thorslund
Monday 18 October 2004 6:50:00 am
I'm trying to setp a switch between the image shown based on the $module_result.path[1].node_id.
I set it up like this:
{ if($module_result.path[1].node_id == "111") } image 1 { else } image 2
But this is not working...
Do any of you have a suggestion for me?
Thanx..
www.VZT.no ( http://www.VZT.no ) VZT References ( http://http://vzt.no/index.php/vzt_eng/referanser ) VZT Extensions ( http://vzt.no/index.php/vzt_eng/extensions ) www.MediaBase.no ( http://www.MediaBase.no )
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