How to show which template is used?

Author Message

Maarten Holland

Thursday 20 October 2005 1:21:39 pm

Hi all,

First of all, my compliments for the new documentation! Quite an improvement!

I know there's a way to show which template is being used, but can't find how. Can anyone tell me please?

I'm specifically looking for the template of the searchbox in the topmenu (not search.tpl).

Cheers,

Maarten

Mark Marsiglio

Thursday 20 October 2005 3:14:14 pm

There are two ways.

1) turn on debug, and add the "list of templates used" to your output (checkbox). You will then see all of the templates in a list at the bottom of debug. You may need to clear the cache to see the full list.

2) Turn on template debug and clear the cache. This will display the template path/name wherever it is used. This disrupts the layout pretty badly, so don't use this on a production site. I am not sure if it will respect debug by IP settings.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Maarten Holland

Friday 21 October 2005 12:07:19 am

Mark,

Thank you very much for your reply. I've tried both 'debug output' and 'template debug' with 'inline template debug' and 'list of used templates'.

It works fine in the admin interface (even the inline template names). In my frontend I get a list of used templates below the page, but no inline template names.

The problem here is that there's no listing of a template concerning the search. This is the list of templates shown:

pagelayout.tpl design/plain/templates/pagelayout.tpl
link.tpl design/standard/templates/link.tpl
setup/debug_toolbar.tpl design/standard/templates/setup/debug_toolbar.tpl
setup/clear_cache.tpl design/standard/templates/setup/clear_cache.tpl
setup/quick_settings.tpl design/standard/templates/setup/quick_settings.tpl

Any ideas? I'd really like to get this to work!

Cheers,

Maarten

J-A Eberhard

Friday 21 October 2005 12:17:55 am

Hi,
Did you clear the cache?
If you look for the search templates, have a look under design/standard/templates/content/ you will find search.tpl and advancedsearch.tpl.
Jacques-André

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

Łukasz Serwatka

Friday 21 October 2005 12:21:02 am

Hi Maarten,

Look in to design/standard/templates/toolbar/line/searchbox.tpl, dont change standard templates. Just copy directory structure and tpl file in to your design directory, design/(your_design)/templates/toolbar/line/searchbox.tpl and do changes.

In
design/standard/templates/toolbar/
are two sub-folders line and full, usage depends how you use your toolbar in line view or full.

Now you have full overview where possible search tpls are located ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Maarten Holland

Friday 21 October 2005 5:06:28 am

Thank you for your replies. I've solved it by copying the 'toolbar' directory to my design.

There are 2 questions left which have been bothering me ever since I've started using ez Publish:

Why are templates sometimes placed in {mydesign}/override/templates while other templates follow the directory structure in {mydesign}/templates. This is kind of confusing for me and makes it really hard to find the template I'm looking for.

The other problem: My cache isn't always cleared properly. While working on the problem stated above, I didn't see any changes after clearing the cache (using the button in the admininterface).

Sometimes I have to remove the template code, clear the cache, place the code back and only then my changes are shown. Do you have any idea what could be causing this?

Thank you for your time: Your help is highly appreciated!

Maarten

Roy Bøhmer

Friday 21 October 2005 5:48:08 am

Q: Why use the override-folder?

eZ comes with some custom templates. You find them in design/standard/.. Since you don't want to mess with them, you copy the file/folder-structure for the template you want to alter to you own design folder.

A common file to copy is templates/node/view/full.tpl. This template is used pretty much for every page. But what if you want your articles to look different than your folders? In other words: What if you want two instances of the same template, to use in two different scenarios?
Then you specify an override in override.ini and place the new file in /design/../override/*.tpl

But, I agree that there is A LOT of files to keep track of :-)

Mark Marsiglio

Friday 21 October 2005 5:56:46 am

In my experience, we use the design/SITE/override/templates/ folder to override standard and base templates just by adding a copy in the same location but in our design.

The design/SITE/templates/ folder is for files referenced by override.ini.append.php which specifies new templates (custom templates that are not overrides of specific base or standard templates) and includes which are called by our other templates such as pagelayout.tpl

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

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