Created
March 19, 2017 18:42
-
-
Save rbaty-barr/c9497c5e4b1a7a511c3bb14e463c9457 to your computer and use it in GitHub Desktop.
Forms and Documents rendering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage | |
<div id="formsDocsArea"> | |
@if(@Model.Content.HasValue("docsFolder") && @Model.Content.GetPropertyValue<string>("asHideShow") == "True"){ | |
var mediaRoot = @Model.Content.GetPropertyValue("docsFolder"); | |
<!-- comment --> | |
foreach( var item in Umbraco.TypedMedia(mediaRoot).Children){ | |
if(@item.ContentType.Alias =="Folder" && Umbraco.TypedMedia(@item.Id).Children.Count() > 0){ | |
@listFolders("hs", @item, Umbraco.TypedMedia(@item.Id).Children.Count().ToString()) | |
} else if(@item.ContentType.Alias !="Folder" && @item.ContentType.Alias !="Image"){ | |
@listDloads("hs", @item) | |
} | |
} | |
} else if(@Model.Content.HasValue("docsFolder") && @Model.Content.GetPropertyValue<string>("asHideShow") == "False"){ | |
var mediaRoot = @Model.Content.GetPropertyValue("docsFolder"); | |
<!-- comment --> | |
foreach( var item in Umbraco.TypedMedia(mediaRoot).Children){ | |
if(@item.ContentType.Alias =="Folder" && Umbraco.TypedMedia(@item.Id).Children.Count() > 0){ | |
@listFolders("bullet", @item, Umbraco.TypedMedia(@item.Id).Children.Count().ToString()) | |
} else if(@item.ContentType.Alias !="Folder" && @item.ContentType.Alias !="Image"){ | |
@listDloads("bullet", @item) | |
} | |
} | |
} | |
</div> | |
@helper listFolders( string HowList, IPublishedContent theFolder, string itemCount ) | |
{ | |
if(HowList == "hs") | |
{ | |
<div class="panel-group @theFolder.Name.Replace(" ", "").ToLower()" id="accordion"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h4 class="panel-title"> | |
<a class="accordion-toggle" data-toggle="collapse" href="#collapse@{@theFolder.Id}"><i class="fa fa-plus-circle"></i> @theFolder.Name (@itemCount)</a> | |
</h4> | |
</div> | |
<div id="collapse@{@theFolder.Id}" class="panel-collapse collapse"> | |
<div class="panel-body"> | |
@foreach(var item in Umbraco.TypedMedia(@theFolder.Id).Children){ | |
@listDloads("hs", @item) | |
} | |
</div> | |
</div> | |
</div> | |
</div> | |
} else if(HowList == "bullet") { | |
<h1>@theFolder.Name</h1> | |
<ul class="list-unstyled"> | |
@foreach(var item in Umbraco.TypedMedia(@theFolder.Id).Children){ | |
@listDloads("bullet", @item) | |
} | |
</ul> | |
} | |
} | |
@helper listDloads( string HowList, IPublishedContent theItem ){ | |
if(HowList == "hs") | |
{ | |
<p><a href="@theItem.Url" target="_blank" class="docList">@theItem.Name</a></p> | |
} else if(HowList == "bullet") { | |
<li><a href="@theItem.Url" target="_blank" class="docList">@theItem.Name</a></li> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment