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
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"/>
}
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
Also a picture showing my layout in the umbraco admin page
Please help me ...
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
Hi Dennis,
Thank you but that doesnt work . I can retrieve the text but this is only happening with images ...
Please help me
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.
Hope this helps,
/Dennis
Hi Dennis,
Am using a textbox .... value is inputted like this /media/1019/bg-productLanding.jpg
haha .. Thank you dennis . It works for a mediaPicker
is working on a reply...