Skip to content

Instantly share code, notes, and snippets.

@rbaty-barr
Last active August 29, 2015 14:04
Show Gist options
  • Save rbaty-barr/5bb88832390535a4fe1b to your computer and use it in GitHub Desktop.
Save rbaty-barr/5bb88832390535a4fe1b to your computer and use it in GitHub Desktop.
render hide shows
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ArchetypeFieldsetModel>
@using Archetype.Models;
@using System.Text;
@using System.Text.RegularExpressions;
<div class="panel-group" id="accordion">
@foreach(var item in Model.GetValue<ArchetypeModel>("hideShowItem")){
var str = "collapse" + @item.GetValue("hideShowTitle").Replace(" ", "");
Regex rgx = new Regex("[^a-zA-Z0-9-]");
var itemID = rgx.Replace(str, "");
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#@itemID" class="accordion-toggle">
<i class="fa fa-plus-square"></i> @Html.Raw(@item.GetValue("hideShowTitle"))
</a>
</h4>
</div>
<div id="@itemID" class="panel-collapse collapse">
<div class="panel-body">
@Html.Raw(@item.GetValue("hideShowBody"))
</div>
</div>
</div>
}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment