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.

eZ debug

Timing: Jan 18 2025 19:36:05
Script start
Timing: Jan 18 2025 19:36:05
Module start 'layout'
Timing: Jan 18 2025 19:36:05
Module start 'content'
Timing: Jan 18 2025 19:36:05
Module end 'content'
Timing: Jan 18 2025 19:36:05
Script end

Main resources:

Total runtime0.8602 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0098 588.0469152.6406
Module start 'layout' 0.00980.0031 740.687539.4922
Module start 'content' 0.01290.8454 780.1797663.9688
Module end 'content' 0.85830.0019 1,444.148416.1250
Script end 0.8601  1,460.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3798160.0002
Check MTime0.00130.1555160.0001
Mysql Total
Database connection0.00170.200610.0017
Mysqli_queries0.790191.8551730.0108
Looping result0.00070.0800710.0000
Template Total0.825596.020.4128
Template load0.00260.302820.0013
Template processing0.822995.667120.4115
Template load and register function0.00010.011610.0001
states
state_id_array0.00170.200110.0017
state_identifier_array0.00210.241020.0010
Override
Cache load0.00220.2530500.0000
Sytem overhead
Fetch class attribute can translate value0.00070.081740.0002
Fetch class attribute name0.00100.115690.0001
XML
Image XML parsing0.00270.315640.0007
class_abstraction
Instantiating content class attribute0.00000.0029120.0000
General
dbfile0.00250.2914240.0001
String conversion0.00000.004340.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs