Copied to clipboard

Flag this post as spam?

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


  • James 251 posts 1169 karma points
    May 30, 2015 @ 19:05
    James
    0

    Get Media Picker property from another page.

    Hello all,

     

    I am creating a partial view for rendering a banner image on each page. If the user has selected a banner image on that page then i will use that. Otherwise the partial view will default to the Media Picker i have on a "Settings Node" i have created.

    I am using Image Cropper data type for my images instead of normal.

    I know how to get a media picker on the same page.

    Here is  my code it doesn't seem to want to work. Can anyoen help?

        var getDefaultImage = Umbraco.Content(1105);

        getDefaultImage = getDefaultImage.ToInt32();

        var defaultImage = Umbraco.Media(getDefaultImage).GetCropUrl("generalBanner");

     

        //Custom Image

        var getCustomImage = CurrentPage.bannerBackgroundImage;

        var customImage = Umbraco.Media(getCustomImage).GetCropUrl("generalBanner");

     

Please Sign in or register to post replies

Write your reply to:

Draft