Guidance on 'overrides'

Author Message

Brian Henkel

Friday 18 April 2008 12:03:55 pm

Hello,

I am fairly new to eZ Publish, so please excuse my ignorance. I've been reading as much as possible to get up-to-speed.

I want to change the layout of my homepage. I know 'overrides' is how I accomplish this. 'pagelayout.tpl' is the main template file. In order to override this, I need to make a copy and place it at: design/ezwebin_site/override/templates/ .

Now I need to change the 'override.ini.append.php' file located at: settings/siteaccess/

Inside the 'override.ini.append.php' file I place:

[pagelayout_override] 

(I can name this anything, correct?)

Source=design/standard/templates/pagelayout.tpl 

(this is the path to the pagelayout.tpl file I'm overriding)

MatchFile=<pagelayoutcopy.tpl>

(MatchFile = whatever I name the new file that will override the previous file)

Subdir=templates


I know I can also add 'Match[class_identifier]=' here for special instances, but I don't believe I need it in this case, correct?

Thanks for your guidance,

Brian

paul bolger

Friday 18 April 2008 9:38:48 pm

Here's one that works for me:

Note the node parameter, this overrides the front page only, and that's its node id. Also note that Subdir=templates refers to override/templates in your siteaccess.

I normally test that the override is working by putting <h1>New Pagelayout</h1> at the top to the template copy. Also, if it doesn't seem to work clear the cache.

[frontpagelayout]
Source=pagelayout.tpl
MatchFile=frontpagelayout.tpl
Subdir=templates
Match[node]=373

Paul Bolger

Siw Helen Thorslund

Saturday 19 April 2008 2:05:39 am

Hi Brian,

Have a look here:

http://ez.no/doc/ez_publish/technical_manual/4_0/templates/the_template_override_system

www.VZT.no ( http://www.VZT.no )
VZT References ( http://http://vzt.no/index.php/vzt_eng/referanser )
VZT Extensions ( http://vzt.no/index.php/vzt_eng/extensions )
www.MediaBase.no ( http://www.MediaBase.no )

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 30 2025 22:22:37
Script start
Timing: Jan 30 2025 22:22:37
Module start 'layout'
Timing: Jan 30 2025 22:22:37
Module start 'content'
Timing: Jan 30 2025 22:22:37
Module end 'content'
Timing: Jan 30 2025 22:22:37
Script end

Main resources:

Total runtime0.0248 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.1250151.2109
Module start 'layout' 0.00530.0036 739.3359220.6875
Module start 'content' 0.00890.0144 960.0234997.9141
Module end 'content' 0.02330.0015 1,957.937533.9922
Script end 0.0247  1,991.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.3218140.0002
Check MTime0.00104.1424140.0001
Mysql Total
Database connection0.00083.075310.0008
Mysqli_queries0.002510.198630.0008
Looping result0.00000.040410.0000
Template Total0.00104.110.0010
Template load0.00083.043510.0008
Template processing0.00031.033410.0003
Override
Cache load0.00052.187110.0005
General
dbfile0.002510.024480.0003
String conversion0.00000.031840.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