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 have a page view Home.cshtml
@foreach(var item in Model.Value<IEnumerable<IPublishedElement>>("retailContent")) { @Html.Partial($"Nested Content/ncHomeRetail", item) }
I have a nestedcontent view ncHomeRetail.cshtml
@foreach(var btn in Model.Value<IEnumerable<IPublishedElement>>("button")) { @Html.Partial($"Nested Content/ncButton", btn) }
I have a nested content view ncButton.cshtml
@if(Model.HasValue("link") && Model.HasValue("text")) { bool newWindow = Model.Value("openInAnewWindow") == null ? false : Model.Value<bool>("openInAnewWindow"); <a href="@Model.Value("link")" target="@newWindow" class="btn">@Model.Value("text")</a> }
I have 2 ncHomeRetail items on the home page. Problem is, it's displaying the ncButton for the first ncHomeRetail item on both ncHomeRetail items.
Everything else on ncHomeRetail displays the correct value. Just not the button piece.
What am I missing?
Bump
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
NestedContent inside NestedContent
I have a page view Home.cshtml
I have a nestedcontent view ncHomeRetail.cshtml
I have a nested content view ncButton.cshtml
I have 2 ncHomeRetail items on the home page. Problem is, it's displaying the ncButton for the first ncHomeRetail item on both ncHomeRetail items.
Everything else on ncHomeRetail displays the correct value. Just not the button piece.
What am I missing?
Bump
is working on a reply...