Newbie: How to attach a template file to a node?

Author Message

Alex Kink

Thursday 21 October 2004 8:44:07 am

Hello,
I looked for an answer but didnt find anything that would help me.
I need to attach a template file (.tpl) that I've put into my design/mypage/templates/ to a specific node - welcome node to be exact.

Thanks for any help!

Marko Žmak

Thursday 21 October 2004 9:46:15 am

First open the admin interface. It's usually something like:

http://yourdomain.com/yoursite_admin

or whatever you called it in the setup process.

- then go to the "Content" tab and see what's the node id of the root folder (it's probably 2).
- then go to Setup->Advanced->Templates and click on: /node/view/full.tpl
- click "Create New" and on the next page type the name of your template, and the node id of the root folder. Then click Create and write your template.
- clear the caches from Setup->Cache management

You'll probably figure out all the details. Also look at this tutorial:

http://www.ez.no/ez_publish/documentation/toc/(from)/36647

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Alex Kink

Monday 25 October 2004 3:01:22 pm

Hello Marko,

thanks for your tip!
However, when I follow through the instructions, I end up getting the frontpage.tpl file displayed within the pagelayout.tpl file. I need the front page to display a completely different layout that is stored in the frontpage.tpl file.

Robin Sørlie

Monday 25 October 2004 3:15:24 pm

You probably need to change the priority your template files is sorted. Your welcome template have to be listet before the frontpage.tpl. Just put 0 (zero) in the priority field of your welcome template, and hit update. This is because ez is starting to read from the top, and when it finds a template that can be used it ignores the rest. So remember to always list the templates associated with a specific node before the "general" ones..

Hope this was understandable :)

Edit: Sorry, I might have misunderstood you. You want a welcome site that is not including the pagelayout at all?

A simple solution is to make a index.html file, cause it will load before index.php. But if you use rewrite rule that won't work.

Alex Kink

Monday 25 October 2004 3:36:21 pm

Yep, I need the front page to be different from all the rest. The front page must have a full flash intro in the header, while the rest of the pages will have a simple looping flash menu. I also have to split the front pages into few sections, such as latest news, etc, while the rest of the pages will have only the content of a selected article.
Just like you said, I though to use an index.html file for front, but then again, I need the content in the news box to be dynamically updated, plus I need a login box on the front page.

Thanks again for all your help guys

Christof Bollenbeck

Tuesday 26 October 2004 6:10:08 am

Hi,

I think I did the same thing you need.

I use my pagelayout.tpl for all pages except the frontpage. For the frontpage, I created an override template in /design/your_site/override/templates called homepagelayout.tpl.

Here is the syntax of the entry in override.ini:

[homepagelayout]
Source=pagelayout.tpl
MatchFile=homepagelayout.tpl
Subdir=templates
Match[node]=<your_node_id>

Hope that helps, Christof

Alex Kink

Tuesday 26 October 2004 12:33:57 pm

Perfect!
Exactly what I needed.
Thank you Christof and everybody else too!

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