Copied to clipboard

Flag this post as spam?

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


  • Akeem 43 posts 198 karma points
    Feb 24, 2016 @ 18:26
    Akeem
    0

    Master layout not showing images in other views except in home page

    my master page images is showing in Homepage but its not showing in other views even though the master layout is using in all the view s. But i can retrieve the images in on other views except homepage .

    below is my code snippet of what i have in the master layout

     <ul class="list-inline footer-links pull-right">
                <li><a href="#"><img class="footer-links--social" src="@Umbraco.Field("socialFacebook")" alt="Facebook"></a></li>
                <li><a href="#"><img class="footer-links--social" src="@Umbraco.Field("socialTwitter")" alt="Twitter"></a></li>
                <li><a href="#"><img class="footer-links--social" src="@Umbraco.Field("socialPinterest")" alt="Pinterest"></a></li>
                <li><a href="#"><img class="footer-links--social" src="@Umbraco.Field("socialInstagram")" alt="Instagram"></a></li>
                <li><a href="#"><img class="footer-links--social" src="@Umbraco.Field("socialYoutube")" alt="YouTube"></a></li>
            </ul>
    

    Also a picture showing my layout in the umbraco admin page image of my content layout on the admin page

    Please help me ...

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 24, 2016 @ 19:04
    Dennis Aaen
    0

    Hi Akeem and welcome to our,

    Try something like this, this should do what you are after

    @Umbraco.Field("socialFacebook", recursive: true)

    Hope this helps,

    /Dennis

  • Akeem 43 posts 198 karma points
    Feb 25, 2016 @ 15:20
    Akeem
    0

    Hi Dennis,

    Thank you but that doesnt work . I can retrieve the text but this is only happening with images ...

    Please help me

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 25, 2016 @ 19:42
    Dennis Aaen
    100

    Hi Akeem,

    Okay so if you are using a media picker to pick the the images for socialFacebook field, and the other social media fields, then you can do it like this.

    if (CurrentPage.AncestorOrSelf(1).HasValue("socialFacebook")){                                         
            var dynamicMediaItem = Umbraco.Media(CurrentPage.AncestorOrSelf(1).socialFacebook);
            <img src="@dynamicMediaItem.umbracoFile" alt="@dynamicMediaItem.Name"/>
        }
    

    Hope this helps,

    /Dennis

  • Akeem 43 posts 198 karma points
    Feb 25, 2016 @ 23:24
    Akeem
    0

    Hi Dennis,

    Am using a textbox .... value is inputted like this /media/1019/bg-productLanding.jpg

  • Akeem 43 posts 198 karma points
    Feb 25, 2016 @ 23:41
    Akeem
    0

    haha .. Thank you dennis . It works for a mediaPicker

Please Sign in or register to post replies

Write your reply to:

Draft