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

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 05:05:59
Script start
Timing: Jan 18 2025 05:05:59
Module start 'layout'
Timing: Jan 18 2025 05:05:59
Module start 'content'
Timing: Jan 18 2025 05:06:00
Module end 'content'
Timing: Jan 18 2025 05:06:00
Script end

Main resources:

Total runtime0.6930 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0079 588.1328152.6406
Module start 'layout' 0.00790.0047 740.773439.4766
Module start 'content' 0.01270.6788 780.2500638.5859
Module end 'content' 0.69150.0014 1,418.835912.1094
Script end 0.6929  1,430.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4714160.0002
Check MTime0.00140.1990160.0001
Mysql Total
Database connection0.00070.103510.0007
Mysqli_queries0.631291.0829640.0099
Looping result0.00070.0943620.0000
Template Total0.656294.720.3281
Template load0.00210.305020.0011
Template processing0.654194.388820.3270
Template load and register function0.00010.012010.0001
states
state_id_array0.00120.172410.0012
state_identifier_array0.00110.160520.0006
Override
Cache load0.00180.2638450.0000
Sytem overhead
Fetch class attribute can translate value0.00080.112740.0002
Fetch class attribute name0.00120.169370.0002
XML
Image XML parsing0.00160.230640.0004
class_abstraction
Instantiating content class attribute0.00000.001970.0000
General
dbfile0.00100.1466300.0000
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
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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs