How to show a specific include, depending on current section?

Author Message

Maarten Holland

Friday 13 February 2004 3:50:41 am

Hello,

I've divided my site into several sections. Depending on which section is being viewed, I want to include a specific page for that section.

I think I can do it with {section show=} but can't figure out wich variable to use for the section. Can anyone tell me that or should I use 'case match' for this purpose?

Thank you in advance,

Maarten

Tore Skobba

Friday 13 February 2004 4:05:26 am

Hi

You could check on the $node being viewed with {$node.object.section_id}, i.e.
{section show=$node.object.section_id|eq(1)}
Load section 1 page
{/section]

Note: the eq syntax might be wrong. Alternatively if you are not in the node template then use {$module_result.section_id} to get the current section.

Tips {$node|attribute(show)} lists all available attributes for $node, where $node can be any variable.

Tore

Maarten Holland

Wednesday 18 February 2004 12:14:40 am

Unfortunately I can't get it to work. If I'm not mistaken, I can't use 'node' when caching is disabled. Is that correct? I've disabled all my caches and try to use the following code:

{section show=$module_result.section_id}|eq(4)}
{include uri="design/support/override/templates/page_4.tpl"}
{/section}

4 Is the number of my section. Can anyone please tell me what I'm doing wrong?

Thank you very much for any help!

Maarten

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

eZ debug

Timing: Jan 19 2025 09:56:16
Script start
Timing: Jan 19 2025 09:56:16
Module start 'layout'
Timing: Jan 19 2025 09:56:16
Module start 'content'
Timing: Jan 19 2025 09:56:16
Module end 'content'
Timing: Jan 19 2025 09:56:16
Script end

Main resources:

Total runtime0.8930 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 589.4141152.6563
Module start 'layout' 0.00450.0020 742.070339.5078
Module start 'content' 0.00660.8850 781.5781469.3672
Module end 'content' 0.89160.0014 1,250.94538.0938
Script end 0.8930  1,259.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3466160.0002
Check MTime0.00120.1374160.0001
Mysql Total
Database connection0.00060.069510.0006
Mysqli_queries0.848394.9901570.0149
Looping result0.00050.0607550.0000
Template Total0.866597.020.4332
Template load0.00180.197120.0009
Template processing0.864796.828420.4323
Template load and register function0.00020.027210.0002
states
state_id_array0.00080.086710.0008
state_identifier_array0.00140.155420.0007
Override
Cache load0.00140.1614250.0001
Sytem overhead
Fetch class attribute can translate value0.00070.079720.0004
Fetch class attribute name0.00160.173930.0005
XML
Image XML parsing0.00020.025420.0001
class_abstraction
Instantiating content class attribute0.00000.000930.0000
General
dbfile0.00060.0635100.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/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
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs