I only want to know how to order the childnode of a folder. I've got some "News & Events" ordered by years(FolderName) what I want to do is redirect the "News" folder to the most recent years with no umbraco.Redirect I want this to be automate, If someone add 2012, it will redirect to 2012, Ive already have the code to know the url and redirect to a page, I've only missing the Find Most Recent news part, i'm going to continu my search, but if someone could help me to accelerate my work, it will be great.
you only have to return in the first loop of the foreach to get only the first one
For those who will have this problem, here's the code. In my situation, this code is generated only in one page and always in the same page so that's why I don't get the node by Id before.
foreach (var ArticleList in @Model.DescendantsOrSelf("ArticleList").OrderBy("Name desc")) { return ArticleList.Url.ToString(); }
order ChildNode
Hi,
I only want to know how to order the childnode of a folder. I've got some "News & Events" ordered by years(FolderName) what I want to do is redirect the "News" folder to the most recent years with no umbraco.Redirect I want this to be automate, If someone add 2012, it will redirect to 2012, Ive already have the code to know the url and redirect to a page, I've only missing the Find Most Recent news part, i'm going to continu my search, but if someone could help me to accelerate my work, it will be great.
Thank you
I've find it,
you only have to return in the first loop of the foreach to get only the first one
For those who will have this problem, here's the code. In my situation, this code is generated only in one page and always in the same page so that's why I don't get the node by Id before.
foreach (var ArticleList in @Model.DescendantsOrSelf("ArticleList").OrderBy("Name desc"))
{
return ArticleList.Url.ToString();
}
is working on a reply...