Forums / General / 3.1: more docs needed on how the template override works

3.1: more docs needed on how the template override works

Author Message

Paul Borgermans

Wednesday 28 May 2003 9:50:43 am

From what I can tell, this is what I understand till now:

- the "automatic" recognition of override templates is no longer true, there needs to be a section in
/settings/siteaccess/<yoursite>/override.ini.append

- to be effective, a template has to have a corresponding section-entry in override.ini.append that looks like:

[<template_file_name_without_extension>]
Source= the base template it will override
MatchFile=the full filename of the template without path
Subdir=directory within /design/<yoursite>/override/
Match[]= array of class, node, or section id's
example:

[medium_image_polle]
Source=node/view/medium_class_5.tpl
MatchFile=medium_image_polle.tpl
Subdir=templates
Match[class]=5
Match[section]=6

Anything else that needs to be mentioned before I create a doc on this?

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Bård Farstad

Wednesday 28 May 2003 12:55:38 pm

This is pretty much how it works. You can still override a file by copying to your siteaccess. E.g. you can override pagelayout.tpl by copying it into your siteaccess ( design/mysite/templates/ or design/mysite/override/templates ).

--bård

Documentation: http://ez.no/doc

Volker Lenz

Friday 06 June 2003 1:08:16 pm

Thanks for this enlightening comment. Saved me hours of configuration. On monday, I hope to release the first productive ezp 3.1-01 site in Germany. (www.de.gtct.com). Isn't that cool ;-)

Gabriel Ambuehl

Friday 06 June 2003 4:03:16 pm

I have no luck.

I gave up on using the template editor as it doesn't seem to create any files at all (just to be sure I'm not running into permission problems I chowned the whole tree to user www so Apache HAS write rights, still no lucks).

So I figured I could do it by hand.

For the time being, I'm using design/user as my site access (I'm lazy blabla ;-). If I put pagelayout.tpl into user/templates it will show up without any troubles but stuff in user/templates/node/view seems to be ignored (but those put into standard WILL be used...).

I wanted to change the design of the Link class (clicking on the line should lead the user to the link directly not to a description of it). Considering it is class 11, I figured I'd add line_class_11.tpl to override/templates and be done with. Nothing happened. Then I tried my luck with override.ini (at some point I decided I don't like the name and renamed the template to line_link.tpl):

[line_link]
Source=node/view/full.tpl
MatchFile=line_link.tpl
Subdir=templates
Match[class]=11
Match[section]=1

but still no luck. I'm especially not sure whether I need to use line or full as source but neither seems to work...

I'm getting the impression that the override system is rather buggy. Or maybe it just hates my FreeBSD 4.8/mod_php 4.3.1 install as it seems to work for others. Oh, aside of having changed pagelayout.tpl, the templates are pretty much virgin.

Templates and overriding them is possibly the most powerful feature of ezpublish 3 but the documentation is nowhere up to it. It would be really nice if someone who actually got it to work and got some clue about how it works where to compile a one stop description of it...

Visit http://triligon.org

eZ debug

Timing: Jan 18 2025 02:11:37
Script start
Timing: Jan 18 2025 02:11:37
Module start 'content'
Timing: Jan 18 2025 02:11:38
Module end 'content'
Timing: Jan 18 2025 02:11:38
Script end

Main resources:

Total runtime0.7807 sec
Peak memory usage4,096.0000 KB
Database Queries201

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 587.8516180.8203
Module start 'content' 0.00530.6402 768.6719643.6797
Module end 'content' 0.64550.1351 1,412.3516337.3594
Script end 0.7806  1,749.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.5156210.0002
Check MTime0.00140.1808210.0001
Mysql Total
Database connection0.00060.073410.0006
Mysqli_queries0.703590.11202010.0035
Looping result0.00200.26241990.0000
Template Total0.752196.320.3761
Template load0.00210.266520.0010
Template processing0.750096.071420.3750
Template load and register function0.00010.011310.0001
states
state_id_array0.00090.113610.0009
state_identifier_array0.00090.119720.0005
Override
Cache load0.00170.2119450.0000
Sytem overhead
Fetch class attribute can translate value0.00170.218650.0003
Fetch class attribute name0.00110.144470.0002
XML
Image XML parsing0.00170.222650.0003
class_abstraction
Instantiating content class attribute0.00000.001370.0000
General
dbfile0.00190.2481410.0000
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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs