Advertisement
Guest User

Untitled

a guest
Mar 19th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
  2.  
  3. <div id="formsDocsArea">
  4. @if(@Model.Content.HasValue("docsFolder") && @Model.Content.GetPropertyValue<string>("asHideShow") == "True"){
  5. var mediaRoot = @Model.Content.GetPropertyValue("docsFolder");
  6. <!-- comment -->
  7. foreach( var item in Umbraco.TypedMedia(mediaRoot).Children){
  8. if(@item.ContentType.Alias =="Folder" && Umbraco.TypedMedia(@item.Id).Children.Count() > 0){
  9. @listFolders("hs", @item, Umbraco.TypedMedia(@item.Id).Children.Count().ToString())
  10.  
  11. } else if(@item.ContentType.Alias !="Folder" && @item.ContentType.Alias !="Image"){
  12. @listDloads("hs", @item)
  13. }
  14. }
  15.  
  16. } else if(@Model.Content.HasValue("docsFolder") && @Model.Content.GetPropertyValue<string>("asHideShow") == "False"){
  17. var mediaRoot = @Model.Content.GetPropertyValue("docsFolder");
  18. <!-- comment -->
  19. foreach( var item in Umbraco.TypedMedia(mediaRoot).Children){
  20. if(@item.ContentType.Alias =="Folder" && Umbraco.TypedMedia(@item.Id).Children.Count() > 0){
  21. @listFolders("bullet", @item, Umbraco.TypedMedia(@item.Id).Children.Count().ToString())
  22.  
  23. } else if(@item.ContentType.Alias !="Folder" && @item.ContentType.Alias !="Image"){
  24. @listDloads("bullet", @item)
  25. }
  26. }
  27. }
  28. </div>
  29.  
  30. @helper listFolders( string HowList, IPublishedContent theFolder, string itemCount )
  31. {
  32. if(HowList == "hs")
  33. {
  34. <div class="panel-group @theFolder.Name.Replace(" ", "").ToLower()" id="accordion">
  35. <div class="panel panel-default">
  36. <div class="panel-heading">
  37. <h4 class="panel-title">
  38. <a class="accordion-toggle" data-toggle="collapse" href="#collapse@{@theFolder.Id}"><i class="fa fa-plus-circle"></i> @theFolder.Name (@itemCount)</a>
  39. </h4>
  40. </div>
  41. <div id="collapse@{@theFolder.Id}" class="panel-collapse collapse">
  42. <div class="panel-body">
  43. @foreach(var item in Umbraco.TypedMedia(@theFolder.Id).Children){
  44. @listDloads("hs", @item)
  45. }
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. } else if(HowList == "bullet") {
  51. <h1>@theFolder.Name</h1>
  52. <ul class="list-unstyled">
  53. @foreach(var item in Umbraco.TypedMedia(@theFolder.Id).Children){
  54. @listDloads("bullet", @item)
  55. }
  56. </ul>
  57. }
  58.  
  59. }
  60.  
  61. @helper listDloads( string HowList, IPublishedContent theItem ){
  62. if(HowList == "hs")
  63. {
  64. <p><a href="@theItem.Url" target="_blank" class="docList">@theItem.Name</a></p>
  65. } else if(HowList == "bullet") {
  66. <li><a href="@theItem.Url" target="_blank" class="docList">@theItem.Name</a></li>
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement