- I am using DXA 1.7.
- I have a schema with a component link field called
navigationSet
. navigationSet
is multivalue fieldnavigationSet
links to only a LinkList
My footerNavigation
model looks something like this:
public class GlobalFooterNavigation : EntityModel
{
[SemanticProperty("c:navigationSet")]
public List<Link> NavigationSets { get; set; }
}
I've created the NavigationSets
model to look like this, which essentially a duplicate of LinkList
[Serializable]
public class NavigationSet<T> : EntityModel
{
public string Headline { get; set; }
public List<T> Links { get; set; }
public NavigationSet()
{
Links = new List<T>();
}
}
Unfortunately, I still cannot access the Headline inside of my template:
@model GlobalFooterNavigation
<div class="footer-navigation">
<div class="footer-panel">
@if (Model.NavigationSets != null)
{
foreach (var navigationSet in Model.NavigationSets)
{
<div class="footer-panel-inner">
<h3>@navigationSet.Headline</h3> <!--comes up empty -->
<ul>
<li><a href="#">Contact company</a></li>
</ul>
</div>
}
}
am I making a mistake in the model, the template, or both?