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
Stupid question:
How do I get the name of a node from ParentID in an HTML template?
Using v4
Gary,
You can get the name of parent node using the inline xslt syntax
<umbraco:Item runat="server" field="parentID" xslt="umbraco.library:GetXmlNodeById({0})/@nodeName" />
(Code is untested, so may need a tweak)
Cheers,
/Dirk
Dirk,
I need to put this in a plain HTML template in Umbraco. I did that and it doesn't display anything.
I need to put this in a plain ole HTML template in Umbraco. I did that and it doesn't display anything. No errors either.<span><umbraco:Item runat="server" field="parentID" xslt="umbraco.library:GetXmlNodeById({1052})/@nodeName" /> </span>None of the runat = "server" syntax works in my templates. Is there something I need to add to my pages to use this?
Thanks,
GaryB
Dirk solution is correct. Please note {0} instead of {1052}
<umbraco:Item ID="Item1" runat="server" field="parentID" xslt="umbraco.library:GetXmlNodeById({0})/@nodeName" ></umbraco:Item>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting name of a node from ParentID in an HTML template
Stupid question:
How do I get the name of a node from ParentID in an HTML template?
Using v4
Gary,
You can get the name of parent node using the inline xslt syntax
(Code is untested, so may need a tweak)
Cheers,
/Dirk
Dirk,
I need to put this in a plain HTML template in Umbraco. I did that and it doesn't display anything.
Dirk,
I need to put this in a plain ole HTML template in Umbraco. I did that and it doesn't display anything. No errors either.
<span><umbraco:Item runat="server" field="parentID" xslt="umbraco.library:GetXmlNodeById({1052})/@nodeName" /> </span>
None of the runat = "server" syntax works in my templates. Is there something I need to add to my pages to use this?
Thanks,
GaryB
Dirk solution is correct. Please note {0} instead of {1052}
is working on a reply...