Are you just starting out with this project/Umbraco? If you are, I would recommend that you use Mvc templating rather than WebForms? The DynamicNode object you are using here (Model) is now legacy and has been fully replaced by IPublishedContent/UmbracoHelper either native in Mvc views or using a Partial View Macro with a WebForms (.master) template.
I would also recommend umbraco.tv as Dennis has above.
Simple razr if statement
Hi everyone,
I'm trying to run a simple if test in Razr, but I'm not familiar with the language so wondered if anyone could help.
What I'm looking to do is the following:
If a field is empty, don't display it - simple right!
Here's what I have so far, but I don't know where to start as I'm getting a runtime error..
Any help would be much appreciated!
Thanks,
Tom
Hi Tom
Give this a try:
Jeavon
Perfect thanks a lot!
So is the hasvalue statement a shorthand for checking if something exists in the page as it's being built?
Could anyone recommend a good solid starting place to learn Razr too?
Thanks!
Tom
Hi Tom,
A goog starting point could be:
http://our.umbraco.org/documentation/Reference/Templating/Macros/Razor/basic-razor-syntax
http://our.umbraco.org/documentation/reference/templating/macros/razor
And the Umbraco TV.
http://umbraco.tv/
The documentation for working with some you the dbuilt-in-property-editors:
http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/built-in-property-editors/
Hope this can helps you and of course keep asking in the forum.
/Dennis
Hi Tom,
Yes, to be really really sure you can do this which will first check the property exists and then check if it has a value
Are you just starting out with this project/Umbraco? If you are, I would recommend that you use Mvc templating rather than WebForms? The DynamicNode object you are using here (Model) is now legacy and has been fully replaced by IPublishedContent/UmbracoHelper either native in Mvc views or using a Partial View Macro with a WebForms (.master) template.
I would also recommend umbraco.tv as Dennis has above.
Jeavon
is working on a reply...