info.magnolia.jcr.util.MetaDataUtil.getTemplate(Node)  should give you what you 
are looking for.

HTH,
Jan

On Jun 4, 2012, at 1:52 PM, Edgar Vonk (via Magnolia Forums) wrote:

> Hi,
> 
> In Magnolia 4.5 how do you get the template (name) of a certain page (node)? 
> We need this because some of our components need to know on which page 
> template they are rendered.
> 
> Before 4.5 we used to do (in JSP):
> [code]${actPage.parent.template}[/code]
> to get the template name of the parent page.
> 
> How do we do this in Magnolia 4.5? In JSP but I am also interested in how to 
> do this in FTL.
> 
> I know I can get to the parent node using:
> [code]
> <c:set var="parentPage" value="${cmsfn:parent(content,'mgnl:page')}"/>[/code]
> 
> And I know I can get the template script (which is not what I want btw) for 
> the _current_ node using
> [code]${def.templateScript}[/code]
> 
> -- 
> Context is everything: 
> http://forum.magnolia-cms.com/forum/thread.html?threadId=d3d5dde8-d262-459b-baa2-654e63668165
> 
> 
> ----------------------------------------------------------------
> For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
> Alternatively, use our forums: http://forum.magnolia-cms.com/
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------




----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to