Created
July 6, 2011 13:47
-
-
Save nul800sebastiaan/1067257 to your computer and use it in GitHub Desktop.
Grouping in Razor (Umbraco 4.7.1)
This file contains hidden or 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
@foreach(var group in Model.Children.InGroupsOf(2)) | |
{ | |
<div class="row-of-two"> | |
@foreach(var item in group) | |
{ | |
<span>@item.Name</span> | |
} | |
</div> | |
} |
It's awesome, man!
This is superb #h5yr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Produces something like:
<div class="row-of-two">
<span>Title 1</span>
<span>Title 2</span>
</div>
<div class="row-of-two">
<span>Title 3</span>
<span>Title 4</span>
</div>
..etc. :)