On my content node, my related link property is populated. I have 7 different links.
I then attempted to add the following logic to my razor template...
@{
var typedRelatedLinksConverted = Model.GetPropertyValue<RelatedLinks>("socialMenuBar");
if (typedRelatedLinksConverted != null && typedRelatedLinksConverted.Any())
{
<ul>
@foreach (var item in typedRelatedLinksConverted)
{
var linkTarget = (item.NewWindow) ? "_blank" : null;
<li><a href="@item.Link" target="@linkTarget">@item.Caption</a></li>
}
</ul>
}
else
{
<p>nothing here</p>
}
}
...But the browser keeps showing nothing here when I render the page.
It's as though 'socialMenuBar' doesn't even exist. But that is the name of my property alias. What things should I check to fix this issue?
After getting some sleep, I discovered a solution to my main problem...how to render related links from within nested content. The following code helped me....
How to render Related Links from within Nested Content
I read the documentation on Related Links 2.
I have a fresh install of Umbraco 7.7.2, using Models Builder in Dll mode, and using the following statements on my home template...
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ContentModels.Home> @using Umbraco.Web.Models
On my content node, my related link property is populated. I have 7 different links.
I then attempted to add the following logic to my razor template...
...But the browser keeps showing
nothing here
when I render the page.It's as though 'socialMenuBar' doesn't even exist. But that is the name of my property alias. What things should I check to fix this issue?
Thanks for any tips
After getting some sleep, I discovered a solution to my main problem...how to render related links from within nested content. The following code helped me....
is working on a reply...