Simple Template Override : Welcome/Index Page

Author Message

Lucid ..

Sunday 12 November 2006 9:36:27 pm

As someone who's new to eZ Publish, I'm following the instructions on creating a simple override for a welcome page. Problem is, regardless of what I do, nothing at all happens. I don't get any changes. What am I doing wrong? Some things are confusing to me, like the override.ini.append.php file is completely commented out ( with /* and */ ), is this intentional for security? I've tried putting my block both inside and outside of the comments but no result. Searching the forums/site has been futile as well, as those changes haven't worked for me either.

All I want to do is have the index page's content area have a different layout (sans menus and navigation) between the header area and the footer area, nothing else (every other webpage I'd like to keep with the default layout). I tried to do simple <style>#layer { display:none; } (with correct syntax), but <style> tags aren't permitted.

Could someone fill me in? I can't imagine its more then 2 or 3 steps to just have the index page show a different content area.

Thanks

Jacobo Quiles

Monday 13 November 2006 12:33:54 am

Hi,

If you want to create an override for your homepage, just create a file called home.tpl in your design/override/templates/full, put your code in. Then create an override of your override.ini (siteaccess/yoursiteaccessname/override.ini.append.php) and add in the first position this override block:

<?php /* #?ini charset="iso-8859-1"?

[homepage]
Source=node/view/full.tpl
MatchFile=full/home.tpl
Subdir=templates
Match[node]=2

...

*/ ?>

When user is viewing the node 2 (default home node id), and is watching a full view, your template home.tpl inside your full folder wil be loaded.

About the '#' i am not very sure why they are there, but it always worked for me the way it comes by default.

Microblau SL
http://www.microblau.net

Lucid ..

Monday 13 November 2006 12:40:12 am

Thank you, your example worked.

I tried every other persons examples and I got no success.

Lucid ..

Monday 13 November 2006 2:56:05 pm

I tried copying this example since it worked for the front page by simply changing the node it points to and renaming the title on it for another page, and it didnt work. Should the code you gave me work on any other page I may want to override via node # ?

Jacobo Quiles

Tuesday 14 November 2006 12:53:58 am

Hi,

yes, it should work. Just make sure the name of the override block is not repeated, also check that your override template is stored in the right place and points to the correct view that is being loaded.

Another example:

<?php /* #?ini charset="iso-8859-1"?

[homepage]
Source=node/view/full.tpl
MatchFile=full/home.tpl
Subdir=templates
Match[node]=2

[mycustomcontactform]
Source=node/view/full.tpl
MatchFile=full/myform.tpl
Subdir=templates
Match[node]=223

...

*/ ?>

Just try not to abuse much of the node matching and see if you can make a class match better. Also try to put this override on the top of the file, if you put the new block at bottom it's possible that there is any other previous override block that is being applied and yours ignored.

Hope it works, if not, let me know.

Microblau SL
http://www.microblau.net

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 21:42:12
Script start
Timing: Jan 30 2025 21:42:12
Module start 'layout'
Timing: Jan 30 2025 21:42:12
Module start 'content'
Timing: Jan 30 2025 21:42:13
Module end 'content'
Timing: Jan 30 2025 21:42:13
Script end

Main resources:

Total runtime1.0048 sec
Peak memory usage8,192.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 588.2656151.2266
Module start 'layout' 0.00810.0043 739.4922220.7188
Module start 'content' 0.01250.9916 960.21094,466.6641
Module end 'content' 1.00400.0008 5,426.875015.8125
Script end 1.0048  5,442.6875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3459160.0002
Check MTime0.00120.1236160.0001
Mysql Total
Database connection0.00170.167610.0017
Mysqli_queries0.898789.4420630.0143
Looping result0.00060.0591610.0000
Template Total0.931792.720.4659
Template load0.00260.260920.0013
Template processing0.929192.463220.4645
Template load and register function0.00170.167610.0017
states
state_id_array0.00120.115110.0012
state_identifier_array0.00140.137620.0007
Override
Cache load0.00200.1956340.0001
Sytem overhead
Fetch class attribute can translate value0.00180.178120.0009
Fetch class attribute name0.00230.226160.0004
XML
Image XML parsing0.00060.056920.0003
class_abstraction
Instantiating content class attribute0.00000.002170.0000
General
dbfile0.00950.9422170.0006
String conversion0.00000.001140.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs