Sections in Sections Issue

Author Message

Arran Price

Sunday 16 January 2005 12:28:44 pm

Hi all,
I have a site with 7 major sections, which are the top 7 nodes off the root node. I also have a large number (say 30) other sections. I need to change the look of the site based on which of the major sections the user is in.
Ive set up appropriate overrides to do this and it works fine, until the user goes into one of the other sections as the override now dosent match.

I figure I can potentially solve this in one of the following ways:
- Create an override for each section - the downside of this is the management overhead, its a lot of work and its going to get messy very quickly.
- Use an override syntax that caters for this (Is there one?)
- The changes in the look could be controlled by a single template with code to determine which "section" the user is in without using section functionality. ie some way of determining which node off the root node the user is in (Im not sure how to do this over multiple levels of hierachy). I think this is probably the best way of achieving what I want but could use some assistance with the code.

Is there a better way of doing this?

Any help greatly appreciated.

cheers

Arran

Kristian Hole

Monday 17 January 2005 11:53:28 am

In the pagelayout there is a number of variables set:

http://ez.no/ez_publish/documentation/customization/custom_design/template_variables_set_by_ezpublish

Some of this info can be used for your use (path.1.node_id?)

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Arran Price

Tuesday 18 January 2005 12:13:50 pm

thanks Kristian,

$module_result.path[1].node_id

did the trick (and was alot easier than I thought it was going to be).

cheers

Arran

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 07:23:47
Script start
Timing: Jan 19 2025 07:23:47
Module start 'layout'
Timing: Jan 19 2025 07:23:47
Module start 'content'
Timing: Jan 19 2025 07:23:48
Module end 'content'
Timing: Jan 19 2025 07:23:48
Script end

Main resources:

Total runtime1.0231 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.0054 589.1563152.6250
Module start 'layout' 0.00540.0024 741.781339.4453
Module start 'content' 0.00781.0140 781.2266532.4297
Module end 'content' 1.02180.0013 1,313.656312.1641
Script end 1.0231  1,325.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3103160.0002
Check MTime0.00140.1325160.0001
Mysql Total
Database connection0.00100.097710.0010
Mysqli_queries0.974095.1988570.0171
Looping result0.00070.0642550.0000
Template Total0.991496.920.4957
Template load0.00200.191220.0010
Template processing0.989596.711520.4947
Template load and register function0.00040.035610.0004
states
state_id_array0.00220.218510.0022
state_identifier_array0.00120.120820.0006
Override
Cache load0.00170.1656250.0001
Sytem overhead
Fetch class attribute can translate value0.00070.070620.0004
Fetch class attribute name0.00280.273140.0007
XML
Image XML parsing0.00060.060920.0003
class_abstraction
Instantiating content class attribute0.00000.001640.0000
General
dbfile0.00160.1528160.0001
String conversion0.00000.001040.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
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs