Rendering related links that are nested content within an archtype
I have a simple archetype that has a link using related link and an image from a media picker. I am not sure how to render that link. I have tried different ways to get it to render with no luck. This current attempt doesn't give an error but it will render this "Umbraco.Web.Models.RelatedLinks" for each of the links. This is what renders that out "@item.GetPropertyValue("houseLink")". Any help would be appreciated thank you!
I ended up having to use a foreach loop to access the related link I have. I have related links to only allow for 1 link but it looks like you still have to use a foreach loop to access the links. Bassically I added this line "var links = item.GetPropertyValue
<ul class="accordion" data-accordion data-allow-all-closed="true">
@if(node.HasValue("housePod")){
var items = node.GetPropertyValue<IEnumerable<IPublishedContent>>("housePod");
var count = 1;
foreach(var item in items){
var links = item.GetPropertyValue<RelatedLinks>("houseLink");
<li class="accordion-item" data-accordion-item>
<a href="#" class="accordion-title"><div class="orangeCircle">@count</div>
@foreach(var link in links){
<u>@link.Caption</u>
}
</a>
<div class="accordion-content" data-tab-content >
@if(item.HasValueImage("houseImage"))
{
var image = item.GetPropertyValue<IPublishedContent>("houseImage");
if(image != null){
<img src="@image.Url" alt="image">
}
}
</div>
</li>
count++;
}
}
</ul>
Rendering related links that are nested content within an archtype
I have a simple archetype that has a link using related link and an image from a media picker. I am not sure how to render that link. I have tried different ways to get it to render with no luck. This current attempt doesn't give an error but it will render this "Umbraco.Web.Models.RelatedLinks" for each of the links. This is what renders that out "@item.GetPropertyValue("houseLink")". Any help would be appreciated thank you!
I ended up having to use a foreach loop to access the related link I have. I have related links to only allow for 1 link but it looks like you still have to use a foreach loop to access the links. Bassically I added this line "var links = item.GetPropertyValue
is working on a reply...