Forums / Setup & design / Where to put templates?

Where to put templates?

Author Message

Douglas Hammond

Tuesday 09 September 2003 8:57:46 am

where should i put tempalte int templates or template/override ?

It looks like i can put them in eaither.

I have the following

<?php /* #?ini charset="utf8"?

[frontpage_pagelayout]
Source=pagelayout.tpl
MatchFile=frontpage_pagelayout.tpl
Subdir=templates
Match[section]=1

[frontpage_line_article]
Source=node/view/line.tpl
MatchFile=frontpage_line_article.tpl
Subdir=templates
Match[section]=1
Match[class]=2

*/ ?>

and i can put the files in either place.

Whats best practice?

Bjørn Kaarstein

Tuesday 09 September 2003 10:25:17 pm

I like to keep my overrides in the override directory, as I think it's more logic to seperate them from the pagelayout file with includes.

Also, if you have the need of overriding ezxmltags or something, they are to be placed in the override directory with the same directory structure as in the standard folder. Those won't have to be specified in your override.ini.append.

Well, that's my point of view - Now for some coffee.

Regards Bjørn

Paul Forsyth

Wednesday 10 September 2003 12:20:45 am

If you are trying to override a template that currently exists you must put *your* new template into the overrides directory. Thats where ez will expect your override to be.

When you declare an override, as you given in your example, it must be put into the templates/override directory otherwise ez falls back on the original.

Paul

Douglas Hammond

Wednesday 10 September 2003 9:22:06 am

That's not the case.

I will use override/templates for now on but i can place my template file in moy above example in either templates or overrride/templates

Is this a bug?

Paul Borgermans

Wednesday 10 September 2003 9:29:03 am

No, its like intented. After experimenting (and the course in Skien), this the current status: there are actually 3 levels / places which determine which templates are used.

The default is to use: /design/standard/templates/.....

This can be overriden by templates in exactly the same directory structure inside /design/<yourdesign>/templates. You can call this the "default" site specific templates. (you may copy the entire folder inside /design/standard/templates/ to this one if you want to make changes to the defaults from standard).

The third one (and which has precedence over the above two) is through the override.ini file. What you specify here lives in /design/<yourdesign>/override/templates if you specify a SubDir=templates

Does that clarify something?

-paul

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

Pontus Magnusson

Thursday 05 August 2004 9:43:22 am

Acttually I can put them in either directory. For example, with this override:

[homepage]
Source=pagelayout.tpl
MatchFile=homepage.tpl
Subdir=templates
Match[node]=2

My homepage.tpl can be in templates/ or override/templates/, it still work...

eZ debug

Timing: Jan 18 2025 16:19:59
Script start
Timing: Jan 18 2025 16:19:59
Module start 'content'
Timing: Jan 18 2025 16:20:00
Module end 'content'
Timing: Jan 18 2025 16:20:00
Script end

Main resources:

Total runtime0.7467 sec
Peak memory usage4,096.0000 KB
Database Queries209

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1328180.8438
Module start 'content' 0.00560.6227 769.9766675.2813
Module end 'content' 0.62830.1183 1,445.2578337.0625
Script end 0.7466  1,782.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.6084210.0002
Check MTime0.00150.2052210.0001
Mysql Total
Database connection0.00060.081010.0006
Mysqli_queries0.673090.13182090.0032
Looping result0.00200.27332070.0000
Template Total0.720396.520.3601
Template load0.00260.351120.0013
Template processing0.717696.109020.3588
Template load and register function0.00010.020010.0001
states
state_id_array0.00070.092210.0007
state_identifier_array0.00070.096320.0004
Override
Cache load0.00230.3106500.0000
Sytem overhead
Fetch class attribute can translate value0.00150.198260.0002
Fetch class attribute name0.00100.129270.0001
XML
Image XML parsing0.00110.152760.0002
class_abstraction
Instantiating content class attribute0.00000.001970.0000
General
dbfile0.00210.2872280.0001
String conversion0.00000.001130.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/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: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs