where is my *.tpl ...?

Author Message

Marcin N.

Monday 11 December 2006 3:39:55 am

Hi!

I tried to change my main content design. I found in pagelayout.tpl:

{$module_result.content}

Then I tried find file which is responsible for this part of code. I found on eZ site that it can be <b>folder.tpl</b>. I found this file in <b>"design/base/override/teplates/full/"</b>. I changed it but it doesn't work! I think it's not this file. My <b>pagelayout.tpl</b> comes from <b>design/base/templates/</b> but in this folder I didn't find <b>folder.tpl</b> :(

How can I check where is template file?

Marcin

Jon Staines

Monday 11 December 2006 4:41:16 am

The template file used $module_result.content depends on the content of that page. folder.tpl would be called if the content was a folder class. The folder.tpl file that you want to override would be in design/<siteaccess>/override/templates/full/ where <siteaccess> is what you chose when installing the site. <b>Do not</b> alter the templates in the base or standard folders, make an override for you site access first and override that.

A good way to see which template is being called is to turn on the debugging in the 'Quick Settings' part of the admin interface. Clear the cache and reload the page and it will show you the template that makes that page. From there you can make an override through the Design/Templates part of the admin interface.

André R.

Monday 11 December 2006 5:44:26 am

You should take a look at the site creation guide in the old documentation:
http://ez.no/ezpublish/documentation/building_an_ez_publish_site

Also:
http://ez.no/doc/ez_publish/technical_manual/3_8/templates/template_basics

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marcin N.

Monday 11 December 2006 5:45:05 am

Jon, thanks for tips!

I used Debug option and now I see! :)
My page using "design/base/templates/pagelayout.tpl"... but under Design/Templates I don't have pagelayout.tpl (I used Filter Option to find it and nothing). It's strange. I want to override this tpl.

sorry for my english! :)

Marcin

Jon Staines

Monday 11 December 2006 6:06:07 am

Give those documents that André linked a read as they give a good grounding for template changes.

To find the template to override you sometimes have to go through all the pages of results in the 'Admin/Templates' section (see the links that go from 1 to 41 or more). The best way to do this I find is to use the find feature in the browser.

For a common template like pagelayout.tpl you will usually find it in the second half of the screen which will save a lot of searching. Make sure you get pagelayout.tpl and not something like print_pagelayout.tpl. Click on the underlined template name and you will be given a dropdown list containing the siteaccesses of your site. Make sure the right one is selected, if it isn't then select it and click Set. Then make a new override. The important bit on this next screen is to select 'Copy of default template'.

Once the override is made, you can really start to learn the templating side.

Marcin N.

Monday 11 December 2006 7:10:43 am

First override is ready! It's pagelayout.tpl :)
It's in folder: "design/my_project_name/override/templates/pagelayout.tpl"

But my site don't want to use new template. Still read pagelayout.tpl from "base" folder. Maybe I have to change "site.ini.append.php":

[DesignSettings]
SiteDesign=my_project_name
AdditionalSiteDesignList[]=base

???

Jon Staines

Monday 11 December 2006 7:19:33 am

If you overrode it through the admin interface then you shouldn't need to change anything. The admin interface will add the override code to the bottom of override.ini.append.php which will look something like:

[new_pagelayout]
Source=pagelayout.tpl
MatchFile=new_pagelayout.tpl
Subdir=templates

Where new_pagelayout is what you called the new file.

Have you cleared the cache since making it?

Marcin N.

Monday 11 December 2006 8:15:22 am

I created new_pagelayout.tpl. I checked override.ini.append.php and there is:

...
[mypro_pagelayout]
Source=pagelayout.tpl
MatchFile=mypro_pagelayout.tpl
Subdir=templates

[pagelayout]
Source=pagelayout.tpl
MatchFile=pagelayout.tpl
Subdir=templates
...

I see "mypro_pagelayout.tpl" in folder "design/mypro/override/templates/mypro_pagelayout.tpl". I downloaded "mypro_pagelayout.tpl" changed few things and put it online. Of course I cleard cache from admin interface and from browser and....NOTHING! Still takes different "pagelayout" (probably from "base" folder).
In site.ini.append.php I have this code:

[DesignSettings]
SiteDesign=mypro
AdditionalSiteDesignList[]=base

I didn't change it.

Jon Staines

Monday 11 December 2006 8:50:20 am

You don't need to change anything in site.ini, that just tells it where to look for it's default templates.

Make sure that the 'mypro_pagelayout' part in override.ini.append.php comes before the 'pagelayout' part. If what you pasted was what you saw in the file then its ok.

Not sure why your one isn't working. Are the file permissions ok on the files you uploaded? Or, try editing the new pagelayout overrides through the admin interface. Just find them in the templates list and click the edit pencil beside them.

Marcin N.

Monday 11 December 2006 9:15:29 am

I didin't touch ini files :)
I removed my overrides and make them again (pagelayout.tpl, folder.tpl, subleft.tpl). eZ Debug shows me that my website using only subleft.tpl from overrides files :(

Marcin

Jon Staines

Monday 11 December 2006 9:21:32 am

Odd. What version of eZ publish are you using?

Marcin N.

Monday 11 December 2006 10:26:18 am

It works!! :) I skiped one thing

Big thanks, now eZ templates are clear for me! :))

André R.

Monday 11 December 2006 3:46:42 pm

Great, but could you for the sake of future beginners also write what was causing this ?

Since you now are on your way to template mastering, I'll give you one other time saving tip. Always look up this page:
http://ez.no/doc/ez_publish/technical_manual/3_8

the moste importing topics for template development can be found in Chapther 5: Reference.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jon Staines

Tuesday 12 December 2006 1:08:52 am

Glad to hear it is working. What was the one thing?

Marcin N.

Tuesday 12 December 2006 7:08:08 am

It was regular mess ;)
I have some old overide .tpl files. I deleted all (from admin panel) and did again the new override. Now works perfect!

For beginners: Before you open FTP client try to use admin interface other way you can make mess like I did ;-)

Marcin

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