@Umbraco.Field("pagename") not working? but @CurrentPage.Name is? Shouldn't both work?
Hi,
I have a template, where i want to print out the generic property with the name of the node.
If i use the GUI in backoffice to do this, i get this razor code:
@Umbraco.Field("pagename")
It does however not do anything. Not printing out the name of the page nor giving an exception.
However, if i use this:
@Umbraco.Field("pagename") not working? but @CurrentPage.Name is? Shouldn't both work?
Hi, I have a template, where i want to print out the generic property with the name of the node. If i use the GUI in backoffice to do this, i get this razor code:
It does however not do anything. Not printing out the name of the page nor giving an exception. However, if i use this:
then it works perfectly.
Does anyone have an explaination on this?
My template is quite simple, it looks like this:
Thanks in advance, Daniel
Hi Daniel and welcome to our :-).
To get the page name of the page, using @Umbraco.Field, you will need to use this syntax.
Hope this helps,
/Dennis
Alright, It works flawlessly now. Perhaps it was some cache or something that was preventing it from showing, when i was testing it.
Thanks, I'm super excited with starting on Umbraco. :)
Great that is works for you now.
Please notice that the uppercased N is in pageName :-) The aliases of the field are generated after the camel casing.
which mean every time you do a space in the name of your property, then it will get a uppercase letter.
Hope this helps,
/Dennis
is working on a reply...