1

I'm looking for the best approach to have a logo link in the header area redirect to different roots based on specific subsites in the same site collection.

Example: all "Radio" pages and subsites have a specific logo that links and points to the top "radio" site. But when in any "athletics" site or subsite, the logo and link would point up to the "athletics" main welcome site.

I need one master to manage all sub sites. I am not applying features. I have access to css, master and javascript. I am not a developer. Athletics, Radio, and the Main site should act like unique sites but are all housed on the same site collection.

Any help on this would be appreciated, as I can apply css "display: none" and just add different logos. I am interested to learn the right approach.

2 Answers 2

1

One thing you could do is simply include all of the logos in the master page but make them hidden by default. Then you could use Javascript to look at the current URL of each page as it is loaded and find the logo that links to a URL that matches as much of the current URL as possible and make that logo visible. Naturally, jQuery would make that script a lot easier to write.

4
  • Thanks Dave, that is a similar approach I am looking at except was going to use alternate css turn on/off with display:none; I just don't know if that is the best approach as I will also use hiding with other header and footer content. Worried Google might flip out with display:none. Mar 1, 2013 at 20:01
  • You can do it that way but I would recommend against it as it requires that you manage a LOT of CSS files instead of a single Javascript file that could be included directly in the Master Page. If one of your subsites needs custom CSS then you have that much more to maintain
    – Dave Wise
    Mar 1, 2013 at 20:05
  • Thanks again Dave. I put a jQuery script together and it works. I am still unsure if people with accessibility related services and devices will be confused with the links being included when javascript is not available. The site is a college site and needs to be 508 accessible. Sorry I thought of that after I built the jquery. Mar 2, 2013 at 2:51
  • here is a link to my attempt: jsfiddle.net/rehmpke/GBzcS Mar 2, 2013 at 3:06
0

This is all default in SharePoint.

When using the default sharepoint masterpage (default.master in 2007, v4.master in 2010) the logo will always point to the top of the site you are on.

Let's say you have your root site which Main. Then you have 2 subsites, Athletics and Radio.

Now, if you are using the default sharepoint masterpage you will automatically be directed to the welcome page of Athletics if you are on any of Athletics sub pages when clicking the logo. This is default sharepoint behavior.

All you need to do is go to Site Settings on both Athletics and Radio and change the logo url under Title, description and logo located under Look and feel.

You don't need CSS nor javascript to accomplish any of this.

4
  • Daniel, I think what he is looking for is something a little different. If I understand him correctly, if he has the structure SiteA/SubSiteB/SubSiteC/ then wants the logo and url at the top of the page to point to /SiteA/ even in SubSiteB or in SubSiteC. You are correct that the logo can be manually changed in Site Settings, but the underlying link would still point to the current subsite, not the top level site
    – Dave Wise
    Mar 4, 2013 at 15:42
  • Thanks Daniel and Dave, what I have is subtly different from what you are talking about. What I have is a single site collection. I have a site with many subsites. I have an athletics site with several subsites under it. Same goes for radio and so on. I need any subsite under those main sites to have their own logo pointing up to their specific root not the main site root. I have thought of CSS to display:none and I have put together a javascript script that looks at the url indexof. The problem with both solutions is that I have to worry about screen readers and google. Mar 5, 2013 at 2:03
  • ex. main has two subsites: 1. Radio several subsites 2. Athletics several subsites the main, radio and athletics all have unique logos and links but any subsite under radio points to radio and any athletics subsite points to athletics. Mar 5, 2013 at 2:19
  • There are other items in each header and footer that will need to be hidden as well as they are not used in all sites nor are they appropriate. Mar 5, 2013 at 2:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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