Detech what template my embed template is.

Author Message

Klaus Hessellund

Friday 06 May 2011 3:22:46 am

Hi,

Is it possible to know what template my embed template is ?

We have a right.tpl where we have narrow content on the right side of the webpage, and we want to detect this in the embed.tpl code, so we can make the right size images etc..

Regards,

Klaus

Marko Žmak

Friday 06 May 2011 3:33:20 am

Try using DebugOutput and ShowUsedTemplates ini settings. Then you'll get a list of used templates in the debug info on the bottom. And clear the cache before loading the page so that you get a complete list of templates.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Klaus Hessellund

Friday 06 May 2011 4:22:11 am

I need to detect it in the template code.

I'm using the nivoslider extension and need to chance the code, so it can change behavier depending on where it is shown on the webpage.

http://projects.ez.no/nivoslider

design/standard/override/templates/embed/nivoslider.tpl

/Klaus

Klaus Hessellund

Friday 06 May 2011 5:00:35 am

At the moment, the solution seems to be to create a new class with another class identifier, and then check for $object.content_class.identifier in the template.

So webeditors have to choose the correkt class depending on where it will be shown. I guess we will call the identifier "nivosliderright".

/Klaus

Quoc Huy Nguyen Dinh

Monday 09 May 2011 4:35:11 am

You could maybe create some new classes for the embed tag (content.ini, such as Itemized Sub Items) and the editors would select the appropriate one depending on which column to embed in.

Gaetano Giunta

Tuesday 10 May 2011 1:02:17 am

Maybe pass some parameters by hand down the template inclusion chain? Or define a var in the pagelayout, set its value in the column tpl and check for its value in the embed tpl...

Principal Consultant International Business
Member of the Community Project Board

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 17 2025 23:56:10
Script start
Timing: Jan 17 2025 23:56:10
Module start 'layout'
Timing: Jan 17 2025 23:56:10
Module start 'content'
Timing: Jan 17 2025 23:56:11
Module end 'content'
Timing: Jan 17 2025 23:56:11
Script end

Main resources:

Total runtime0.6834 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.0469152.6406
Module start 'layout' 0.00710.0037 740.687539.4844
Module start 'content' 0.01080.6710 780.1719656.6563
Module end 'content' 0.68180.0015 1,436.828112.4375
Script end 0.6833  1,449.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4649160.0002
Check MTime0.00130.1901160.0001
Mysql Total
Database connection0.00110.161310.0011
Mysqli_queries0.625391.4995700.0089
Looping result0.00070.1051680.0000
Template Total0.649095.020.3245
Template load0.00230.330020.0011
Template processing0.646694.626120.3233
Template load and register function0.00020.028410.0002
states
state_id_array0.00110.160810.0011
state_identifier_array0.00130.189520.0006
Override
Cache load0.00190.2739270.0001
Sytem overhead
Fetch class attribute can translate value0.00050.074040.0001
Fetch class attribute name0.00140.201190.0002
XML
Image XML parsing0.00190.272740.0005
class_abstraction
Instantiating content class attribute0.00000.002790.0000
General
dbfile0.00100.1505320.0000
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
6content/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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs