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");
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");
is working on a reply...