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.

eZ debug

Timing: Jan 18 2025 22:11:21
Script start
Timing: Jan 18 2025 22:11:21
Module start 'layout'
Timing: Jan 18 2025 22:11:21
Module start 'content'
Timing: Jan 18 2025 22:11:22
Module end 'content'
Timing: Jan 18 2025 22:11:22
Script end

Main resources:

Total runtime0.6348 sec
Peak memory usage4,096.0000 KB
Database Queries78

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.0156152.6250
Module start 'layout' 0.00650.0029 740.640639.4453
Module start 'content' 0.00940.6240 780.0859718.5703
Module end 'content' 0.63340.0013 1,498.656320.1563
Script end 0.6348  1,518.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5442160.0002
Check MTime0.00150.2372160.0001
Mysql Total
Database connection0.00100.151710.0010
Mysqli_queries0.556187.6061780.0071
Looping result0.00090.1398760.0000
Template Total0.594593.720.2973
Template load0.00250.391820.0012
Template processing0.592093.259720.2960
Template load and register function0.00010.019810.0001
states
state_id_array0.00210.336710.0021
state_identifier_array0.00090.136820.0004
Override
Cache load0.00220.3531590.0000
Sytem overhead
Fetch class attribute can translate value0.00070.111550.0001
Fetch class attribute name0.00100.1607110.0001
XML
Image XML parsing0.00160.258350.0003
class_abstraction
Instantiating content class attribute0.00000.0033120.0000
General
dbfile0.00821.2940280.0003
String conversion0.00000.001640.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs