Forums / Setup & design / Displaying used template name

Displaying used template name

Author Message

Ted Striker

Friday 16 February 2007 1:44:51 am

Hi,

I've been looking the forum for an answer, but did not find anything.

I want to output, let say, in a template called "view_article.tpl" the name of the template itself, that is:

Used template: view_article.tpl

Is there anywhere a variable (inside $node for example) holding this info?

Thats of course is for debug purposes, I have a very complex site, where many templates are included depending on the content and knowing in which template a bug is, can be a nightmare.

Thank you!!

Can you feel it Mr. Anderson? Closing in on you? Oh I can, I really should thank you after all. It was, after all, it was your life that taught me the purpose of all life. Purpose of life is to end.

Nabil Alimi

Friday 16 February 2007 2:37:24 am

Hi Ted,

Could the inline template debug solve your problem as it displays the name of the template in HTML comments ?

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

André R.

Friday 16 February 2007 2:48:42 pm

My dev settings:

[ContentSettings]
ViewCaching=disabled

[TemplateSettings]
Debug=disabled
ShowXHTMLCode=disabled
ShowUsedTemplates=disabled
TemplateCache=disabled
TemplateCompile=disabled
TemplateOptimization=disabled
DevelopmentMode=enabled

[DebugSettings]
DebugOutput=enabled
DebugRedirection=disabled
DebugByIP=disabled
DebugToolbar=disabled

Just turn on Debug to locate witch template is being used and so.
Among a lot more info in the debug output it also inserts html comments witch makes Internet explorer run in quirks mode. Thats why I don't enable it by default.

NB! Remember to turn on Viewcache, Templatecache and TemplateCompile and test everything before going live, a lot of cache and templateCompiler related errors could be hiding from you..

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

Betsy Gamrat

Friday 16 February 2007 5:04:36 pm

Another method would be to adopt a simple coding standard, where you add an HTML comment into each template.

It will create overhead, but during development, it may be worth it.

For example: <!-- node/view/folder_full.tpl -->

You could use sed to swap the comments to be {* *} when you don't need the HTML anymore.

Ted Striker

Wednesday 28 February 2007 4:33:38 am

Thanks to all, inline template debug will do the job!!!

Can you feel it Mr. Anderson? Closing in on you? Oh I can, I really should thank you after all. It was, after all, it was your life that taught me the purpose of all life. Purpose of life is to end.

eZ debug

Timing: Jan 18 2025 22:38:51
Script start
Timing: Jan 18 2025 22:38:51
Module start 'content'
Timing: Jan 18 2025 22:38:53
Module end 'content'
Timing: Jan 18 2025 22:38:53
Script end

Main resources:

Total runtime1.6918 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 588.8438180.8359
Module start 'content' 0.00911.5346 769.6797653.4141
Module end 'content' 1.54370.1480 1,423.0938337.0938
Script end 1.6917  1,760.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00470.2782210.0002
Check MTime0.00190.1127210.0001
Mysql Total
Database connection0.00130.078110.0013
Mysqli_queries1.605494.89122040.0079
Looping result0.00230.13862020.0000
Template Total1.625196.120.8126
Template load0.00220.132320.0011
Template processing1.622995.925120.8114
Template load and register function0.00010.006410.0001
states
state_id_array0.00240.143810.0024
state_identifier_array0.00430.253620.0021
Override
Cache load0.00190.1134310.0001
Sytem overhead
Fetch class attribute can translate value0.00130.079350.0003
Fetch class attribute name0.00130.074590.0001
XML
Image XML parsing0.00220.130350.0004
class_abstraction
Instantiating content class attribute0.00000.0009100.0000
General
dbfile0.00230.1357460.0000
String conversion0.00000.000330.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
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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs