Copied to clipboard

Flag this post as spam?

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


  • Brian Reimer 30 posts 120 karma points
    Dec 18, 2013 @ 12:21
    Brian Reimer
    0

    Making it recursive?

    Any ways of making this work recursive in my template?

     @if(Model.Content.HasValue("kologo")){
        var mediaItem = Umbraco.TypedMedia(Model.Content.GetPropertyValue("kologo")); 
        <img src="@mediaItem.GetPropertyValue("umbracoFile")" alt="@mediaItem.GetPropertyValue("Name")"/>    
        }
    
  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Dec 18, 2013 @ 12:23
    Jeavon Leopold
    101

    Hi Brian,

    Yes and it's wonderfully easy:

    @if (Model.Content.HasValue("kologo", true))
    {
        var mediaItem = Umbraco.TypedMedia(Model.Content.GetPropertyValue("kologo", true));
        <img src="@mediaItem.GetPropertyValue("umbracoFile")" alt="@mediaItem.GetPropertyValue("Name")" />
    }
    

    Jeavon

  • Brian Reimer 30 posts 120 karma points
    Dec 18, 2013 @ 12:37
    Brian Reimer
    0

    I was on the right track - always good to know :)

    Thanks (again)

Please Sign in or register to post replies

Write your reply to:

Draft