Monday, October 27, 2008

To Change the seperator icon after "My Site" and "My Links" in the top right corner of SharePoint HomePage

Since the existing seperator pipe icon('') immediatly after "My Site" and "My Links" is incorporated in "MySite" feature, it can't be directly pointed/changed to some other image, by using SharePoint Designer. For this we need to create a new feature and use this feature instead of existing feature. Please follow the steps mentioned below for that.

1) Copy the new image to SharePoint "Images" folder (i.e "C:\program files\common files\microsoft shared\web server extensions\12\TEMPLATE\IMAGES")

2) Create a new feature in FEATURES folder:
  • Go to FEATURES folder (i.e. "C:\program files\common files\microsoft shared\web server extensions\12\TEMPLATE\FEATURES").
  • Copy the existing "MySite" feature.(Select "MySite" folder) and paste it there.
  • Name the feature as "NewMySite" by renaming the copied folder.
  • It will contain two xml files namely "Feature.xml" and "
    MySiteFeatureElements.xml".

3) Modify "Feature.xml" file:

  • Open the "Feature.xml" in Visual Studio IDE.
  • Create a GUID and replace the Feature Id in the xml with the new GUID.

(To generate GUID, go to the folder "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools" and click on "guidgen.exe" and copy the GUID generated. If you want to have shortcut for generating GUID in the Visual Studio IDE, open Visual Studio IDE. Click on "Tools", then "External tools". In the Dialog window, add the following.

Title : Create &GUID

Command: C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\guidgen.exe

Initial Directory: C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\

Then, click on "OK". Next time Go to "Tools" and click on "Create GUID" to generate new GUID.

  • Replace the "Farm" with "Web" for "Scope" attribute.
  • Replace "TRUE" with "FALSE" for "Hidden" attribute.
  • Save the "Feature.xml" file.

4) Modify "MySiteFeatureElements.xml" file

  • In the xml file, modify the "Sequence" value from 100 to less value (like 90) for each of the three controls.
  • Create new user controls in CONTROLTEMPLATES folder to be pointed in this xml file.
  • Go to CONTROLTEMPLATES folder i.e. "C:\program files\common files\microsoft shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES"
  • Copy "MySiteLink.ascx" file and paste it and rename it to "NewMySiteLink.ascx".
  • In "newMySiteLink.ascx" file, comment/remove the two lines and insert an image which points to the new image in _layouts folder like:

*

  • Similary copy "MyLinks.ascx" file and paste it & rename it to "NewMyLinks.ascx".
  • Edit the file and comment/remove line and insert new line for image as above.
  • Save the both files
  • Replace the "ControlSrc" urls with the new ascx files created in the above steps as follows:





  • Save the file.

5) Modify the scope in master page file:

Since the default scope of the SharePoint Delegate controls "GlobalSiteLink1" and "GlobalSiteLink2" is "Farm", we don't want to affect these changes in entire farm level, we need to change it to "Web" scope. For that open SharePoint Designer. Open your default master page and change the scope of "GlobalSiteLink1" and "GlobalSiteLink2" Delegate controls to "Web" level.

Web" runat="server"/>

Web" runat="server"/>

6) Install Feature:

  • Open Command Prompt and change the directory to "C:\program files\common files\microsoft shared\web server extensions\12\BIN".
  • Execute the installfeature command as follows

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o installfeature -filename NewMySite\Feature.xml -force

7) Activate the Feature to your Site collection:

  • Execute the activatefeature command as follows.

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o activatefeature -filename NewMySite\Feature.xml -url http://idc-dk-is:44510/sites/TestSite

8) Reset IIS

9) Open your web site and check the change in the seperator image.

2 comments:

Anonymous said...

I used a dirty trick.
first, i gave the surrounding td an id ("bwk-GlobalSiteLink2")

<script ...>
function BwkGlobalSiteLink2()
{
bwkGlobalSiteLink2 = document.getElementById('bwk-globalSiteLink');
cells = bwkGlobalSiteLink.GetElementsByTagName('td');
if(cells.length==2) cells[1].style.display='none';
}
</script>
_spBodyOnLoadFunctionNames.push('BwkGlobalSiteLink2');


worked like a charm!

Unknown said...

Hi there,

I've followed your steps to the letter and everything seemed to work fine, the feature installed without issues, however when I render my page, nothing id displayed. I have changed the Scope to Web for both Links.

Any advice on debugging would be great.

Thanks

Andrew Weddle