Simple Template Override : Welcome/Index Page

Simple Template Override : Welcome/Index Page

Sunday 12 November 2006 9:36:27 pm - 4 replies

Author Message

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

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.