I am having a hard time trying to get my logo image to display on any other page besides the homepage.
I know I must be doing something wrong with the razor markup...
<a class="visible-lg" href="@home.Url">
@{
if (CurrentPage.HasValue("siteLogo")){
var dynamicMediaItem = Umbraco.Media(CurrentPage.siteLogo);
<img src="@dynamicMediaItem.Url" alt="@dynamicMediaItem.Name"/>
}
}
</a>
I know that I am targeting the "Current Page;" however I can't get it to appear any other way. Am I supposed to integrate .AncestorOrSelf()?
I also can't seem to get it to work with @home.siteLogo.
I guess I am looking for the best way to display an image (from the media picker) on all pages of the site from the property "siteLogo" under my Home document type.
It was just kind of a hunch with the recursive and != null parts that I put in, but I don't know exactly how/why it works (haha) but at least it works!
If someone wants to step in and explain it, that would be great!
Logo image only displaying on homepage and not any child pages
Hi,
Still trying to figure out Umbraco, so please forgive my naiveté.
I am having a hard time trying to get my logo image to display on any other page besides the homepage.
I know I must be doing something wrong with the razor markup...
I know that I am targeting the "Current Page;" however I can't get it to appear any other way. Am I supposed to integrate .AncestorOrSelf()?
I also can't seem to get it to work with @home.siteLogo.
I guess I am looking for the best way to display an image (from the media picker) on all pages of the site from the property "siteLogo" under my Home document type.
Any help would be greatly appreciated.
Thanks,
Amanda
Alright, it seems I was able to solve the problem with this code:
It was just kind of a hunch with the recursive and != null parts that I put in, but I don't know exactly how/why it works (haha) but at least it works!
If someone wants to step in and explain it, that would be great!
is working on a reply...