Multiple Pagelayouts

Author Message

Don MacLeod

Thursday 02 October 2003 2:57:14 am

I wish to have multiple sections on my site which have different page layouts - banner, links, background color etc. To achieve this I realise that I need a separate pagelayout template per section.

Question is - How do I structure my templates, override/templates directories and override.ini.append to assign a pagelayout for a section? I can see how to assign class templates based on section ...

Match[section]=4

... but my ideal solution would be to have a pagelayout.tpl per section and be able to integrate the class template types such as article, image, product etc within each one by using the override mechanism (not by emebedding the source code for each one in the pagelayout.tpl).

What I'm trying to say is that I don't want to end up with loads of separate pagelayout files with the class already integrated in them like .....

pagelayout_section_1_article.tpl
pagelayout_section_1_infopage.tpl
pagelayout_section_1_image.tpl
pagelayout_section_2_article.tpl
pagelayout_section_2_infopage.tpl
pagelayout_section_2_image.tpl
v
v
v
v
pagelayout_section_x_article.tpl
pagelayout_section_x_infopage.tpl
pagelayout_section_x_image.tpl

Any ideas?

Thanks,

Don.

Don MacLeod

Thursday 02 October 2003 9:07:28 am

OK - I've found a solution to my own question.

I added the following to override.ini.append ...

[pagelayout_corporate]
Source=pagelayout.tpl
MatchFile=pagelayout_corporate.tpl
Subdir=templates
Match[section]=4

... which means that the corporate pagelayout template is invoked for content belonging to that section (4). What this also means is that the [folder], [article], [image] etc templates can be applied to whichever section template is the current one.

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 18 2025 19:15:55
Script start
Timing: Jan 18 2025 19:15:55
Module start 'layout'
Timing: Jan 18 2025 19:15:55
Module start 'content'
Timing: Jan 18 2025 19:15:56
Module end 'content'
Timing: Jan 18 2025 19:15:56
Script end

Main resources:

Total runtime0.5693 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0391152.6250
Module start 'layout' 0.00640.0033 741.664139.4453
Module start 'content' 0.00970.5576 781.1094427.9922
Module end 'content' 0.56740.0019 1,209.10168.1719
Script end 0.5693  1,217.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.6303160.0002
Check MTime0.00140.2454160.0001
Mysql Total
Database connection0.00120.207610.0012
Mysqli_queries0.523491.9401520.0101
Looping result0.00040.0696500.0000
Template Total0.535994.120.2679
Template load0.00270.482120.0014
Template processing0.533193.645420.2666
Template load and register function0.00030.046010.0003
states
state_id_array0.00120.206210.0012
state_identifier_array0.00140.237720.0007
Override
Cache load0.00210.3739330.0001
Sytem overhead
Fetch class attribute can translate value0.00050.080310.0005
Fetch class attribute name0.00140.253620.0007
XML
Image XML parsing0.00010.018810.0001
class_abstraction
Instantiating content class attribute0.00000.000920.0000
General
dbfile0.00080.1351100.0001
String conversion0.00000.001840.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/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: 10
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs