That's why it is a little confusing when to us "Name" or "pageName"
If I did create a property "Name" would it not conflict. And in the build-in razor-template-snippets (eg. List subpages by limit and datetime) @item.Name is used.
It is indeed a bit odd.I guess they use the dynamic "Name" property as a shortcut to the "pageName" alias, but this raises then indeed the question of what happens if you add a "Name" property yourself...
I hope one of the razor guru's will be able to give you an answer :-)
The Name is an actual existing property on DynamicNode and is not available as a Dynamic property, like pageName. The pageName is a shortcut to Name though.
I think the problem here is that your can only query on dynamic properties and that Gareth might've forgotten to add Name as an additional filter.
OrderBy: Name vs. pageName
I am using Umbraco 4.7.1
I want ot order nodes by the node-name.
Thought that "Name" was the way to go - But this does NOT work:
Using "pageName" works:
Is it correct that it is not possible to order by "Name"?
/Mikkel
Hi Mikkel,
Not until you create yourself a property on your document type with the alias called "Name"...
Cheers,
Michael.
But I can get the name of the node by
@node.Name
That's why it is a little confusing when to us "Name" or "pageName"
If I did create a property "Name" would it not conflict. And in the build-in razor-template-snippets (eg. List subpages by limit and datetime) @item.Name is used.
Mmh,
It is indeed a bit odd.I guess they use the dynamic "Name" property as a shortcut to the "pageName" alias, but this raises then indeed the question of what happens if you add a "Name" property yourself...
I hope one of the razor guru's will be able to give you an answer :-)
Cheers,
Michaƫl.
The Name is an actual existing property on DynamicNode and is not available as a Dynamic property, like pageName. The pageName is a shortcut to Name though.
I think the problem here is that your can only query on dynamic properties and that Gareth might've forgotten to add Name as an additional filter.
Actually, OrderBy("Name") works fine for me in 4.7.1.1 so this might be fixed already.
It looks like it is only "Name" the I cannont "order by". It works fine with "id", "updatedDate" and added properties on doctype.
Looks like a bug-issue.
I have not upgraded from 4.7.1 to 4.7.1.1
But have looked in the changelog, but could not see any in the log.
The plan is to do the upgrade :-)
Thanks for helping :-)
I had the exact same problem. See the solution here:
http://our.umbraco.org/forum/developers/razor/27527-Order-by-not-working-i-codebehind
Best regards
Jimmy
is working on a reply...