Forums / Setup & design / Simple Template Override : Welcome/Index Page

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

eZ debug

Timing: Jan 18 2025 05:03:19
Script start
Timing: Jan 18 2025 05:03:19
Module start 'content'
Timing: Jan 18 2025 05:03:20
Module end 'content'
Timing: Jan 18 2025 05:03:20
Script end

Main resources:

Total runtime1.2022 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.0063 587.8438180.8125
Module start 'content' 0.00631.1816 768.6563564.2969
Module end 'content' 1.18790.0142 1,332.953146.0703
Script end 1.2021  1,379.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2474140.0002
Check MTime0.00130.1042140.0001
Mysql Total
Database connection0.00070.061310.0007
Mysqli_queries1.137594.6177640.0178
Looping result0.00080.0648620.0000
Template Total1.162196.720.5811
Template load0.00210.176220.0011
Template processing1.160096.491420.5800
Template load and register function0.00020.016510.0002
states
state_id_array0.00220.178810.0022
state_identifier_array0.00200.164020.0010
Override
Cache load0.00170.1437340.0001
Sytem overhead
Fetch class attribute can translate value0.00060.052720.0003
Fetch class attribute name0.00150.126160.0003
XML
Image XML parsing0.00090.071020.0004
class_abstraction
Instantiating content class attribute0.00000.001270.0000
General
dbfile0.00550.4593190.0003
String conversion0.00000.000530.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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