Forums / Setup & design / Templates match with more than one node

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>

eZ debug

Timing: Jan 18 2025 15:57:10
Script start
Timing: Jan 18 2025 15:57:10
Module start 'content'
Timing: Jan 18 2025 15:57:11
Module end 'content'
Timing: Jan 18 2025 15:57:11
Script end

Main resources:

Total runtime1.3530 sec
Peak memory usage4,096.0000 KB
Database Queries208

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.9609180.8281
Module start 'content' 0.00691.2244 769.7891627.5469
Module end 'content' 1.23130.1216 1,397.3359341.0703
Script end 1.3530  1,738.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.2827210.0002
Check MTime0.00150.1074210.0001
Mysql Total
Database connection0.00050.034510.0005
Mysqli_queries1.278494.48262080.0061
Looping result0.00210.15532060.0000
Template Total1.287895.220.6439
Template load0.00230.166620.0011
Template processing1.285595.013520.6428
Template load and register function0.00020.016010.0002
states
state_id_array0.00510.374610.0051
state_identifier_array0.00120.091020.0006
Override
Cache load0.00200.1443320.0001
Sytem overhead
Fetch class attribute can translate value0.00200.144940.0005
Fetch class attribute name0.00090.064390.0001
XML
Image XML parsing0.00120.087340.0003
class_abstraction
Instantiating content class attribute0.00000.0016120.0000
General
dbfile0.00370.2705330.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs