Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am creating master page where I need to show parent's nodeName.
Is it possible without using XSLT?
Hi Alex, you could use:
<% =umbraco.presentation.nodeFactory.Node.GetCurrent().Parent.Name %>
although if using this with the root node, then you'll have to change it to check that the Parent isn't null:
HTH,
Hendy
Thank you! It is work.
But how could I call macro with parent id?
<umbraco:Macro Alias="contentHeader" source="<% =umbraco.presentation.nodeFactory.Node.GetCurrent().Parent.Id %>" runat="server"></umbraco:Macro>
Does not work.
Alex,
You can use inline xslt which would prevent you from needing to create a separate macro. Or maybe you're opposed to xslt on principal :-)
Anyway, you could call the page field like the following to display the parent name without using macro:
<umbraco:Item runat="server" field="pageID" xslt="umbraco.library:GetXmlNodeById({0})/parent::node/@nodeName " />
Hope that helps.
-Chris
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to show parent field in child template
I am creating master page where I need to show parent's nodeName.
Is it possible without using XSLT?
Hi Alex, you could use:
although if using this with the root node, then you'll have to change it to check that the Parent isn't null:
HTH,
Hendy
Thank you! It is work.
But how could I call macro with parent id?
<umbraco:Macro Alias="contentHeader" source="<% =umbraco.presentation.nodeFactory.Node.GetCurrent().Parent.Id %>" runat="server"></umbraco:Macro>
Does not work.
Alex,
You can use inline xslt which would prevent you from needing to create a separate macro. Or maybe you're opposed to xslt on principal :-)
Anyway, you could call the page field like the following to display the parent name without using macro:
Hope that helps.
-Chris
is working on a reply...