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.