Templates match with more than one node

Author Message

willy jansen

Wednesday 29 September 2004 8:12:12 am

How di I configure override.ini.append.php so a template matches one or more nodes?

[special_view]
Source=node/view/full.tpl
MatchFile=full/special_view.tpl
Subdir=templates
Match[node]=163,164

or

[special_view]
Source=node/view/full.tpl
MatchFile=full/special_view.tpl
Subdir=templates
Match[node]=163
Match[node]=164

Anybody any idea?

Alex Jones

Wednesday 29 September 2004 8:31:27 am

Actually, you have to do:

[special_view_1]
Source=node/view/full.tpl
MatchFile=full/special_view.tpl
Subdir=templates
Match[node]=163

[special_view_2]
Source=node/view/full.tpl
MatchFile=full/special_view.tpl
Subdir=templates
Match[node]=164

Rather repetitive, but sadly, that's how the system works.

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Frederik Holljen

Wednesday 29 September 2004 11:31:52 pm

I've put this on my list of "nifty things that we should implement".

Alex Jones

Thursday 30 September 2004 10:40:17 am

That's great to hear Frederik! One more request, which I believe I filed as a bug/suggestion a good while back (let me know if I should do it again):

Template matching should not be founded on a principal of order within the override.ini.append file, rather it should be based on a foundation of specificity, like CSS. For example, I have the following overrides in my override.ini.append file, in the order shown (Assume the they all have the ability to affect one node, which is of class 14, is a child of node 2, and has a node of 23):

[first_override]
Source=node/view/full.tpl
MatchFile=full/first_override.tpl
Subdir=templates
Match[class]=14

[second_override]
Source=node/view/full.tpl
MatchFile=full/second_override.tpl
Subdir=templates
Match[parent_node]=2

[third_override]
Source=node/view/full.tpl
MatchFile=full/third_override.tpl
Subdir=templates
Match[node]=23

The current implementation would automatically apply the first override, ignoring the other two, which are more specific. This really isn't logical from a user/site developer stand point, though it may make sense from the CMF developer's standpoint - I assume, it cuts down on the time it takes to find the right override, please correct me if I am wrong. Ideally, the system would see that the third override is the most specific and apply it instead of the other two.

I know it is a lot to ask, but I figured I would ask anyway. ;)

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Frederik Holljen

Thursday 30 September 2004 11:51:58 pm

I'll put this in my list as well. I don't think this is anything we'll do in the near future though.

willy jansen

Friday 01 October 2004 11:37:32 am

Thanks for the hint. It works perfect.

Alex Jones

Friday 01 October 2004 12:33:55 pm

<b>Frederik:</b> Thanks for adding it to the list. I know it is a long shot. ;)

<b>Willy:</b> Glad to help!

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

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

Main resources:

Total runtime1.0601 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.1641152.6406
Module start 'layout' 0.00610.0029 741.804739.4766
Module start 'content' 0.00901.0496 781.2813622.4531
Module end 'content' 1.05860.0015 1,403.734416.1406
Script end 1.0601  1,419.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3531160.0002
Check MTime0.00180.1727160.0001
Mysql Total
Database connection0.00070.061710.0007
Mysqli_queries0.989693.3510710.0139
Looping result0.00070.0661690.0000
Template Total1.018896.120.5094
Template load0.00240.225320.0012
Template processing1.016495.876420.5082
Template load and register function0.00020.021310.0002
states
state_id_array0.00160.153410.0016
state_identifier_array0.00200.185120.0010
Override
Cache load0.00210.2011320.0001
Sytem overhead
Fetch class attribute can translate value0.00060.053530.0002
Fetch class attribute name0.00120.109090.0001
XML
Image XML parsing0.00190.175630.0006
class_abstraction
Instantiating content class attribute0.00000.0028120.0000
General
dbfile0.00100.0928220.0000
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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
5content/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: 29
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs