1

We have used a starter master page and created a visual studio master page solution. The master page has OOB global level navigation.

These navigation have sites(Site A, Site B, SIte C) in them and in-turn have subsite(A1,A2,A3;B1,B2,B3;C1,C2,C3). On the site collection page we have a logo1. But when the user clicks on site lets say Site B, the logo should change in the master page to LogoB. Likewise when the user clicks on Site C

How can this be achieve?

Here is the code for the Link Button

<div class="ms-dialogHidden">
<SharePoint:AjaxDelta ID="Custom_Logo" BlockElement="true" runat="server"><SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/">
<SharePoint:SiteLogoImage ID="xxxxxxxxxxxxxxxxxxxx" LogoImageUrl="&lt;% $SPUrl:~sitecollection/_catalogs/masterpage/StarterBranding/logo.jpg %&gt;" AlternateText="Back to Home" runat="server" />
</SharePoint:SPLinkButton>
</SharePoint:AjaxDelta> </div>
  • Where are (would be) the images stored? Is the navigation "hard-coded"? If no, what would happen if a new site is created later? – Evariste Jan 22 '16 at 12:16
  • I have update the script blog – spStacker Jan 22 '16 at 13:31
2

OK, I completely edited my answer, see answer versioning to get the comlete previous one.

Now that I've seen your markup, here what I think:
You should use (note ~site instead of ~sitecollection):
<SharePoint:SiteLogoImage ID="xxxxxxxxxxxxxxxxxxxx" LogoImageUrl="&lt;% $SPUrl:~site/_catalogs/masterpage/StarterBranding/logo.jpg %&gt;" AlternateText="Back to Home" runat="server" />

And you manually upload a different logo.jpg in each sub-site, at in _catalogs/masterpage/StarterBranding.
This way, even if you create new sites later, it will be easy to upload the corresponding image at this location.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.