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...

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 31 2025 04:24:18
Script start
Timing: Jan 31 2025 04:24:18
Module start 'layout'
Timing: Jan 31 2025 04:24:18
Module start 'content'
Timing: Jan 31 2025 04:24:18
Module end 'content'
Timing: Jan 31 2025 04:24:18
Script end

Main resources:

Total runtime0.0126 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1250151.2109
Module start 'layout' 0.00510.0021 739.335936.6484
Module start 'content' 0.00720.0044 775.984494.1406
Module end 'content' 0.01160.0010 870.125037.9922
Script end 0.0126  908.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002016.1079140.0001
Check MTime0.00097.0360140.0001
Mysql Total
Database connection0.00075.896310.0007
Mysqli_queries0.002217.400330.0007
Looping result0.00000.079210.0000
Template Total0.00086.410.0008
Template load0.00064.741610.0006
Template processing0.00021.613210.0002
Override
Cache load0.00043.339710.0004
General
dbfile0.00097.498380.0001
String conversion0.00000.047240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs