Umbraco check if property has value

When using the CMS, we need to display the values on the front-end, in doing so we need to check that the editor has entered values into the properties.

In this blog, I will show you how to check for null values in an Umbraco RTE, string and image media.

If the property has a value, it will be displayed, if the property does not have a value, we display the default value.

The code for this example can be downloaded from GitHub with the link at the bottom of the page.

To set this example up, I have created a view model, controller and new doctype in the CMS. With these in place, I can now display the examples.

Leave a comment