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
hello
I want to access Parent's heading property in template which is applied to its children. How can I write Razor for that in template? Is that possible?
Yes, of course! You can access the current node's parent by using DynamicNode's Parent property. If the heading property's alias is heading, then something like:
<umbraco:Macro runat="server" language="cshtml"> string heading = Model.Parent.heading; <h1>@heading</h1></umbraco:Macro>
...should get the job done.
thank you..
but in my template it works as below and not by declaring string.
<h1>@Model.Parent.heading;</h1>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Parent property in template
hello
I want to access Parent's heading property in template which is applied to its children. How can I write Razor for that in template? Is that possible?
Yes, of course! You can access the current node's parent by using DynamicNode's Parent property. If the heading property's alias is heading, then something like:
...should get the job done.
thank you..
but in my template it works as below and not by declaring string.
is working on a reply...