Guest User

Untitled

a guest
Mar 19th, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. @inherits UmbracoViewPage<dynamic>
  2.  
  3. @if (Model != null && Model.sections != null)
  4. {
  5. bool oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
  6.  
  7. <div class="umb-grid">
  8. @if (oneColumn)
  9. {
  10. foreach (var section in Model.sections)
  11. {
  12. foreach (var row in section.rows)
  13. {
  14. @renderRow(row);
  15. }
  16. }
  17. }
  18. else
  19. {
  20. <div class="columns">
  21. @foreach (var s in Model.sections)
  22. {
  23. <div class="column is-@s.grid">
  24. @foreach (var row in s.rows)
  25. {
  26. @renderRow(row);
  27. }
  28. </div>
  29. }
  30. </div>
  31. }
  32. </div>
  33. }
  34.  
  35. @helper renderRow(dynamic row)
  36. {
  37. <div class="columns">
  38. @foreach (var area in row.areas)
  39. {
  40. <div class="column is-@area.grid">
  41. @foreach (var control in area.controls)
  42. {
  43. if (control != null && control.editor != null && control.editor.view != null )
  44. {
  45. <text>@Html.Partial("grid/editors/base", (object)control)</text>
  46. }
  47. }
  48. </div>
  49. }
  50. </div>
  51. }
Add Comment
Please, Sign In to add comment