I got a liste there should be listed out by descending BUT, all nodes with the properti nrOne set to "true" should be listed out before every other nodes.
I thought I could solve it by doing like this OrderBy("nrOne,SortOrder descending". But it dosent work :P
@foreach (var group in Model.Content.Children.Where("Visible").OrderBy("nrOne,SortOrder descending").InGroupsOf(2))
{
<div class="imagesContainer">
<div class="row">
@foreach (var node in group)
{
<a class="item" href="@node.Url">
@if(node.HasValue("vlgeImageThumb")){
var mediaItem = Umbraco.TypedMedia(node.GetPropertyValue("vlgeImageThumb"));
<div class="imageThumb">
<img src="@CropUp.GetUrl(mediaItem.Url, new ImageSizeArguments{CropAlias = "pressebilledethumb"})" alt="@mediaItem.Name" title="@mediaItem.Name" />
</div>
}
<span>@node.Name</span>
</a>
}
</div>
</div>
}
OrderBy multiple parameters
Hi Guys
I got a liste there should be listed out by descending BUT, all nodes with the properti nrOne set to "true" should be listed out before every other nodes.
I thought I could solve it by doing like this OrderBy("nrOne,SortOrder descending". But it dosent work :P
Hi Mads,
I was thinking if you could so something like this:
I found my inspiration from this post.
http://our.umbraco.org/forum/developers/razor/44053-Order-Blogs-by-Datepicker-property-first,-then-createDate
Hope this helps,
/Dennis
I almost se the point in the script - but it just throws me an error on the foreach right under :P
Dennis's suggestion looks good to me, could you try exactly like this?
If you have any error could you please post the full error here?
is working on a reply...