Forums / Setup & design / Different image as top

Different image as top

Author Message

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

eZ debug

Timing: Jan 20 2025 01:03:39
Script start
Timing: Jan 20 2025 01:03:39
Module start 'content'
Timing: Jan 20 2025 01:03:40
Module end 'content'
Timing: Jan 20 2025 01:03:41
Script end

Main resources:

Total runtime1.3877 sec
Peak memory usage4,096.0000 KB
Database Queries201

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.9453180.8438
Module start 'content' 0.00721.1858 769.7891645.3047
Module end 'content' 1.19300.1947 1,415.0938337.3828
Script end 1.3877  1,752.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.3051210.0002
Check MTime0.00160.1120210.0001
Mysql Total
Database connection0.00070.049510.0007
Mysqli_queries1.249790.05672010.0062
Looping result0.00270.19311990.0000
Template Total1.345096.920.6725
Template load0.00220.159620.0011
Template processing1.342796.757020.6714
Template load and register function0.00020.017410.0002
states
state_id_array0.00210.148110.0021
state_identifier_array0.00260.190920.0013
Override
Cache load0.00190.1348240.0001
Sytem overhead
Fetch class attribute can translate value0.00150.108550.0003
Fetch class attribute name0.00120.087180.0002
XML
Image XML parsing0.01901.370950.0038
class_abstraction
Instantiating content class attribute0.00000.001180.0000
General
dbfile0.04823.4754460.0010
String conversion0.00000.001930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs