I am trying to render out some some tabbed content.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
//This retrieves the value from property. Nested content is always an IEnumerable of IPublishedContent (from my experience)
var tabs = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("tabs");
}
<ul class="tab">
<li><a href="javascript:void(0)" class="tablinks" onclick="openCity(event, 'London')">London</a></li>
</ul>
@foreach(var panel in tabs )
{
//Next we loop through each panel in the accordion
<div id="@panel.GetPropertyValue("title")" class="tabcontent">
<h3>@panel.GetPropertyValue("title")</h3>
<p>@panel.GetPropertyValue("content")</p>
</div>
}
Would I use a separate foreach loop to render each of the
tags that build the tabs? And also, would this be a case of replacing London with @panel.GetPropertyValue("title") both for the value and the ID?
I was trying it earlier but only resulted in crashing my Visual Studio!
Outputting tabbed content
Hi
I am trying to render out some some tabbed content.
Would I use a separate foreach loop to render each of the
I was trying it earlier but only resulted in crashing my Visual Studio!
Thanks Graham
is working on a reply...