Using 1 template for more than one section/node etc?

Author Message

Clemens T

Wednesday 11 May 2005 12:52:30 am

Heya all,
I was wondering if it is possible for me to specify more than one section/node/class for a template. It would be redundant to copy the templates I'd say. Please let me know if this is possible, so if I edit this one template, both pages will change.
Greets,
Clemens
ps: I'm not afraid of the ini files, so if it's only possible through there I'd love to hear it;).

edit: obviously I'm talking about an override here.

Hans Melis

Wednesday 11 May 2005 6:22:48 am

You can use the same override template for multiple "targets", but you can't do it with just one block in the override.ini file because you can't use an OR condition between match keys.

So you have to create one block in override.ini per match.

Example:

[news_folder]
Source=node/view/full.tpl
MatchFile=full/news_folder.tpl
Subdir=templates
Match[class_identifier]=folder
Match[node]=63

[sports_folder]
Source=node/view/full.tpl
MatchFile=full/news_folder.tpl
Subdir=templates
Match[class_identifier]=folder
Match[node]=64

Both point to the same template, but with different match keys. Also make sure the name of the block (eg [news_folder]) is different for each block.

hth

Hans
http://blog.hansmelis.be

Clemens T

Wednesday 11 May 2005 6:43:47 am

Thanks, I think this is exactly what I was looking for!! Kudos for you!
Greets,
Clemens

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

Main resources:

Total runtime1.0032 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.0055 590.4375152.6406
Module start 'layout' 0.00560.0030 743.078139.4766
Module start 'content' 0.00860.9918 782.5547531.0781
Module end 'content' 1.00050.0027 1,313.632812.1250
Script end 1.0031  1,325.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.4331160.0003
Check MTime0.00200.1944160.0001
Mysql Total
Database connection0.00060.058010.0006
Mysqli_queries0.952194.9121570.0167
Looping result0.00060.0564550.0000
Template Total0.968996.620.4845
Template load0.00230.227320.0011
Template processing0.966696.359420.4833
Template load and register function0.00020.021010.0002
states
state_id_array0.00100.098210.0010
state_identifier_array0.00210.205020.0010
Override
Cache load0.00160.1620210.0001
Sytem overhead
Fetch class attribute can translate value0.00070.074220.0004
Fetch class attribute name0.00140.136740.0003
XML
Image XML parsing0.00060.057420.0003
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00180.1749150.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
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/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: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs