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
Hi all,
using 4.7 I was running the following:
in 4.7.1 something seems to be mucked up with the implementation of AncestorOrSelf(int Level) because it's returning null for AncestorOrSelf(2) in exactly the same macro no structures have been changed...
can someone explain please..
<umbraco:Macro runat="server" language="cshtml"> <div class="images-and-links"> @if (Model.image is int) { <img src="@Model.Media("image").umbracoFile" alt="" /> } @if (@Model.AncestorOrSelf(2).Children.Any()) { <div class="links"> @if (Model.AncestorOrSelf(2).Id != Model.Id) { <a href="@Model.AncestorOrSelf(2).Url" class="parent"> @(string.IsNullOrEmpty(@Model.AncestorOrSelf(2).title.ToString()) ? @Model.AncestorOrSelf(2).Name : @Model.AncestorOrSelf(2).title) </a> } <ul> @foreach (var childPage in @Model.AncestorOrSelf(2).Children) { if (childPage.HasAccess && childPage.NodeTypeAlias != "LoginPage") { <li> @if (Model.Id != childPage.Id) { <a href="@childPage.Url"> @(string.IsNullOrEmpty(childPage.title.ToString()) ? childPage.Name : childPage.title) </a> } else { @(string.IsNullOrEmpty(childPage.title.ToString()) ? childPage.Name : childPage.title) } </li> } } </ul> </div> } </div> </umbraco:Macro>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
AncestorOrSelf in 4.7.1
Hi all,
using 4.7 I was running the following:
in 4.7.1 something seems to be mucked up with the implementation of AncestorOrSelf(int Level) because it's returning null for AncestorOrSelf(2) in exactly the same macro no structures have been changed...
can someone explain please..
is working on a reply...