Forums / Extensions / Detech what template my embed template is.

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