Different pagelayout for root node full view and sitemap?

Author Message

Chris McCulloh

Friday 28 January 2005 2:21:01 pm

I've come into an interesting scenario, and quite perhaps it's because I'm only a few months into eZ Publish (although insanely happy, best CMS I've worked with, by far).

Currently I have three different pagelayouts setup as follows in my site override:

[flash]
Source=pagelayout.tpl
MatchFile=flash.tpl
Subdir=templates
Match[node]=2

[districtmap]
Source=pagelayout.tpl
MatchFile=districtmap.tpl
Subdir=templates
Match[node]=300

[regular_pagelayout]
Source=pagelayout.tpl
MatchFile=regular_pagelayout.tpl
Subdir=templates

So basically, I have two different pagelayouts for nodes 300 and 2, and then a default for all of the other ones.

The problem is, I need to use the default pagelayout for the sitemap and when I access /content/view/sitemap (or the alias, either or), the layout for node 2 is used. Checking all the template variables, I've since come to realize that viewing the root node and the sitemap seem to be almost completely identical save for the uri ('/sitename' and '/content/view/sitemap') and the viewmode (root: 'full', sitemap: 'sitemap').

The problem is, from what I've dug up on the site, neither of these can be used to override the template that is used. All of the parameters you can use (e.g., node_id, object_id, parent_id, class, etc) have the same value when viewing either the root node or the sitemap! I assume this is because the sitemap is given the node_id that correlates to the node at which it is oriented to.

Any idea how I can force the sitemap module to use the default layout template, and not the one specifically intended for the full view of the root node? I could use a section show comparison at the start of a page to include the default template if it is a sitemap view, or include the root template if it's a full root view, but this doesn't seem terribly elegant..

Thanks

Balazs Halasy

Friday 28 January 2005 2:38:22 pm

Hi,

It is late and I'm not 100% clear in the head, but can't you just do something like "/layout/set/my_layoyt/content/view/sitemap"? Just thinking about the quickest way to solve your problem - definetively not so elegant, but might work... read this page:

http://www.ez.no/ez_publish/documentation/reference/modules/layout

Cheers!

Allman

Chris McCulloh

Friday 28 January 2005 8:57:49 pm

Thanks for the heads up -- I'm a bit embarassed I didn't find the layout module on my own. I suspected something like it existed, but... well, who knows.

It works, but it did necessitate some changes. Had to eliminate any references to ezurl and change them to ezroot to avoid the /layout/set/layoutname being prepended to every link (which is fine since the necessary VH changes had already been made), and add an entry for the default pagelayout to my layout.ini.append so that the layout module could find it.

Thanks!

Vlad Bailescu

Thursday 26 May 2005 8:30:15 am

Not being able to set a layout based on the view is one major pain in the a$$! Add to this the awkward solution to deal with multilanguage sites (using different siteaccesses for your site) and you will have a real mess, forcing you to kick in tons of |ezroot and a large number of overrides. This really sucks! Any advice from the developers?

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 01:12:49
Script start
Timing: Jan 19 2025 01:12:49
Module start 'layout'
Timing: Jan 19 2025 01:12:49
Module start 'content'
Timing: Jan 19 2025 01:12:50
Module end 'content'
Timing: Jan 19 2025 01:12:50
Script end

Main resources:

Total runtime0.8480 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 590.5469152.6563
Module start 'layout' 0.00730.0030 743.203139.5078
Module start 'content' 0.01030.8364 782.7109553.2578
Module end 'content' 0.84680.0012 1,335.968812.0938
Script end 0.8480  1,348.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3850160.0002
Check MTime0.00140.1602160.0001
Mysql Total
Database connection0.00080.100110.0008
Mysqli_queries0.787792.8882620.0127
Looping result0.00070.0792600.0000
Template Total0.816396.320.4082
Template load0.00190.229220.0010
Template processing0.814396.027520.4072
Template load and register function0.00020.028310.0002
states
state_id_array0.00120.146910.0012
state_identifier_array0.00120.142820.0006
Override
Cache load0.00160.1938240.0001
Sytem overhead
Fetch class attribute can translate value0.00090.105430.0003
Fetch class attribute name0.00130.147450.0003
XML
Image XML parsing0.00070.081930.0002
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00080.0934160.0000
String conversion0.00000.000940.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
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
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs