Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sara Coutinho 4 posts 24 karma points
    Mar 19, 2012 @ 14:42
    Sara Coutinho
    0

    Umbraco 5 - Image validation

    Hi all,

    I have a document type with a media picker property and I'm trying to check if the field is empty or not. The Umbraco 4.7 way doesn't work any more:

    @if (Model.HasValue("image"))
    {
        dynamic mediaItem = Model.MediaById(Model.GetPropertyValue("image"));
        if (mediaItem.NodeTypeAlias == "Image")
        {
                <img src="@mediaItem.umbracoFile" />
        }
    }

    And I tried a few things but no luck. Does any of you know how to do the same on Umbraco 5?

    Thanks,

    Sara

  • wolulcmit 357 posts 693 karma points
    Mar 20, 2012 @ 14:30
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies