Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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:
Layout = "MasterPage.cshtml";
<h2>@Umbraco.Field("pagename")</h2> //does nothing
@Model.Content.Name //does nothing
@CurrentPage.Name //works perfectly
Thanks in advance,
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,
It works flawlessly now.
Perhaps it was some cache or something that was preventing it from showing, when i was testing it.
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.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted