I've use UMB 7, but I'm new to 7 and I guess this is so simple that I can't find the answer to it.
I added a field to my document type, no problems with that, same as UMB6. But when I try to use it, I get the yellow screen of death, or nothing. Let's call the field "NewField" and it's a multi-line text field.
Absolute beginners: adding a field and using it
I've use UMB 7, but I'm new to 7 and I guess this is so simple that I can't find the answer to it.
I added a field to my document type, no problems with that, same as UMB6. But when I try to use it, I get the yellow screen of death, or nothing. Let's call the field "NewField" and it's a multi-line text field.
(1) This gives a YSOD:
@if (string.IsNullOrWhiteSpace(CurrentPage.NewField) == false) { ...}
(2) and this just doesn't ever return true:
@if(CurrentPage.HasValue("NewField")){ ... }
Please feel free to tell me to RTFM, but which manual would that be? I'm looking everywhere I can...
Ok, got it, here's the manual:
http://our.umbraco.org/documentation/reference/Templating/Mvc/views
@Umbraco.Field("fieldName", insertBefore: "<h2>", insertAfter: "</h2>")
is working on a reply...