none
Change top left text to Hyper Link

    Question

  • We want to set the text in the upper left hand corner of all sites so that the text is a hyper link back to the main portal page. This way if you are in the Enterprise Search page or the Mysites page, there is a quick link to get back to the main portal. We figured out how to make the link:

    $MySite=get-spsite "https://portal.mycompany.com"
    $MySite.WebApplication.SuiteBarBrandingElementHtml = '<a class="ms-core-brandingText" href="https://portal.mycompany.com" >MyCompany Intranet</a>'
    $MySite.WebApplication.update()

    The only problem with this is that the color of the link is wrong. It comes out purple (#639) (a:visited) on a blue back ground instead of white on a blue background (we want it to always be white).  I am guessing that I need to update the ms-core-brandingText in a style sheet, but I cannot figure out what the right way to do that is... I have developers who know CSS, but none know SharePoint (we are running SharePoint 2013)... Can someone get me pointed in the right direction...

    We are using the default look and have not created a custom theme. Having no SharePoint developers we are trying to keep the configuration simple if possible.

    Wednesday, March 27, 2013 4:44 PM

Answers

  • So after some thought on this, I have decided to drop the CSS file method. In keeping with my keep it simple philosophy, I came up with the following:

    $MySite=get-spsite "https://portal.mycompany.com"
    $MySite.WebApplication.SuiteBarBrandingElementHtml = '<a style="color:#fff" href="https://portal.mycompany.com" >MyCompany Intranet</a>'
    $MySite.WebApplication.update()

    I am not sure what the Microsoft recommended way is to make this happen, but after having a number of seasoned web developers (java / Linux) unable to figure out how to do this in SharePoint using a CSS file, I have decided that maybe CSS is just not a good idea for this. Still open to suggestion, but I don't seem to be able to do this without a lot of complication.


    • Edited by Oldguard Thursday, March 28, 2013 3:16 PM
    • Marked as answer by Oldguard Thursday, March 28, 2013 7:06 PM
    Thursday, March 28, 2013 3:15 PM

All replies

  • Hi Oldguard,

    My suggestion is creating a new CSS file in the Style Library with what you want.

    Then, proceed to "Site Settings > Site Master Page Settings", section "Alternate CSS URL", select "Specify a CSS file to be used by this site and all sites that inherit from it:" and add the reference to your file. If you want to apply changes to existing sub-sites, don't forget to tick the box below.

    Cheers,

    Alex


    Alex Ferreira :: Blog: http://sharepointsofview.blogspot.com/ :: Twitter: @alexaem

    Wednesday, March 27, 2013 5:30 PM
  • A couple of questions:

    Where should I put the CSS file within the site?

    If I create a CSS file what happens to the settings from the Pallette? Do I need to create a CSS that includes everything from the palette, or do the Palette and the CSS become some kind of combination?

    What I had tried to do (which didn't work) was to copy Palette001.spcolor to Pallet033.spcolor and then add a line for the ms-core-brandingText and then reference the new Palette in a new composed look. How much of that is completely misunderstanding Sharepoint?

    Wednesday, March 27, 2013 6:46 PM
  • So I created a CSS with the following in it:

    MyCompany-branding {
      padding-left: 20px;
      color: #fff;
      width: 100%;
      font-size: 1.2em; }

    I saved that file to: https://portal.mycompany.com/Style Library

    I then went to Site Settings > Site Master Page Settings and selected the Alternate CSS URL \ CSS file and the check box... I then updated by script to make the class MyCompany-branding...

    As far as I can tell, the CSS file is not recognized. The text I am trying to format is not configured for padding, font size or color.

    Wednesday, March 27, 2013 7:08 PM
  • So, 2 questions:

    1. Is the CSS loaded in the pages?
    2. Is the link on top updated to include your class?

    One of these is failing, need to figure out which.

    Was the masterpage customized before?

    Cheers


    Alex Ferreira :: Founder of Get-SP.com :: Twitter: @alexaem

    Thursday, March 28, 2013 10:30 AM
  • So I figured out that it works fine if I am the site owner. It does not load at all for anyone else... It gives an access denied error. I don't see a way to change the permissions on the css file.

    Where was I suppose to save the file to?

    I know the CSS is good because it works for my administrator account... I don't think anyone else has access to the file...

    I created the file here...

    https://portal.mycompany.com/Style%Library/mycompany.css

    Thursday, March 28, 2013 2:53 PM
  • Probably you need to check in, publish and approve the file, for everyone to see it (including anonymous, if your site allows anonymous access).

    Cheers


    Alex Ferreira :: Founder of Get-SP.com :: Twitter: @alexaem

    Thursday, March 28, 2013 3:09 PM
  • So after some thought on this, I have decided to drop the CSS file method. In keeping with my keep it simple philosophy, I came up with the following:

    $MySite=get-spsite "https://portal.mycompany.com"
    $MySite.WebApplication.SuiteBarBrandingElementHtml = '<a style="color:#fff" href="https://portal.mycompany.com" >MyCompany Intranet</a>'
    $MySite.WebApplication.update()

    I am not sure what the Microsoft recommended way is to make this happen, but after having a number of seasoned web developers (java / Linux) unable to figure out how to do this in SharePoint using a CSS file, I have decided that maybe CSS is just not a good idea for this. Still open to suggestion, but I don't seem to be able to do this without a lot of complication.


    • Edited by Oldguard Thursday, March 28, 2013 3:16 PM
    • Marked as answer by Oldguard Thursday, March 28, 2013 7:06 PM
    Thursday, March 28, 2013 3:15 PM
  • I had checked it in... That didn't seem to matter. No idea why...

    Thursday, March 28, 2013 5:11 PM