Forums / Setup & design / Newbie: How to attach a template file to a node?

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!

eZ debug

Timing: Jan 31 2025 01:25:42
Script start
Timing: Jan 31 2025 01:25:42
Module start 'content'
Timing: Jan 31 2025 01:25:42
Module end 'content'
Timing: Jan 31 2025 01:25:42
Script end

Main resources:

Total runtime0.1897 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0115 588.0781370.2734
Module start 'content' 0.01150.0124 958.35161,009.5781
Module end 'content' 0.02380.1658 1,967.92973,897.7891
Script end 0.1896  5,865.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00452.3792200.0002
Check MTime0.00140.7132200.0001
Mysql Total
Database connection0.00110.584610.0011
Mysqli_queries0.095750.43961410.0007
Looping result0.00130.70681390.0000
Template Total0.165487.210.1654
Template load0.00070.379610.0007
Template processing0.164686.805310.1646
Override
Cache load0.00050.269410.0005
Sytem overhead
Fetch class attribute can translate value0.00201.034910.0020
XML
Image XML parsing0.00030.143410.0003
General
dbfile0.00542.8357200.0003
String conversion0.00000.005330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs