Did you want to hide the sign-in link on your SharePoint sites from your intranet users? May be because you didn’t want them to click on it or because they may find it confusing? Well, there is one elegant way to do this on the client web browser side using HTML + JavaScript. The effect will be that the link will not be present by default but will still be accessible via a special Easter Egg sort of short cut!
Customizing the Standard Pages
All you need to do is to locate the following code in your master page:
<td valign=”middle” class=”ms-globallinks”>
<wssuc:Welcome id=”IdWelcome” runat=”server” EnableViewState=”false”>
</wssuc:Welcome>
</td>
and then replace it with:
<td valign=”middle” class=”ms-globallinks”>
<div id=”welcomeDiv” style=”display:none”>
<wssuc:Welcome id=”IdWelcome” runat=”server” EnableViewState=”false”>
</wssuc:Welcome>
</div>
<a href=”#welcome” accesskey=”s” onclick=”javascript:document.getElementById(‘welcomeDiv’).style.display=’block’;” />
</td>
This will hide the whole Welcome Panel when the page is displayed in the web browser and will define a hidden anchor link that will be accessible via a hot-key Alt + S in the example above. Because the link doesn’t have any text it will be invisible and you won’t be able to click on it. However the JavaScript onclick event will still be triggered if you activate the link using the short cut key and then press enter. So if you press Alt + S and then press Enter the Welcome Panel will show up and you will be able to use it. Try it, it’s really cool
Note that this will not stop users from signing-in with different accounts. So this is not a solution for a security problem, it’s just a nice little touch to your portal and user experience.
Customizing the System Pages
This is a nice solution for the standard publishing pages of your portal, but not the system pages (such as Upload.aspx, EditForm.aspx etc). All system pages on your portal use as a master page a single page in the 12 hive called application.master. If you want to hide the sign-in link on the system pages as well then you have two alternatives:
A) You could just directly edit the application.master page in your 12 hive and insert the same HTML code as shown above. Remember this will change all site collections in all SharePoint web applications running on your box.
B) You could hide the whole system links panel at the top right corner for a single site collection or a web application by applying a custom theme. This will also include the “My Sites” link as well as the “Welcome” link and the “Help” link. You could implement this as a feature receiver for example and apply the custom theme using code. Then to hide the whole panel in the theme.css file of your theme you need to overwrite the .ms-globalright class as follows:
.ms-globalright
{
float:right;
display:none;
}
So far so good, however because both your custom master page and the application.master pages are using the same .ms-globalright style for the system links panel, the above style change will also unconditionally hide the panel from the normal pages. To get around this in addition to adding the secret short-cut HTML you should also explicitly overwrite the display CSS property for the system links panel in your custom master page by adding style=”display:block;” to the table element as follows:
<table cellpadding=”0″ cellspacing=”0″ height=100% class=”ms-globalright” style=”display:block;”>
<tr>
…
<td valign=”middle” class=”ms-globallinks”>
<div id=”welcomeDiv” style=”display:none”>
<wssuc:Welcome id=”IdWelcome” runat=”server” EnableViewState=”false”>
</wssuc:Welcome>
</div>
<a href=”#welcome” accesskey=”s” onclick=”javascript:document.getElementById(‘welcomeDiv’).style.display=’block’;” />
</td>
…
</tr>
</table>
Well that’s all! Now the normal pages will not show the sign-in link but it will be still accessible via the secret short-cut and all system pages will have a custom theme and will not show the system links panel at all.
In order to setup your own theme you will have to do some extra work such as actually creating the theme under \12\TEMPLATE\THEMES and registering the theme in the SPTHEMES.XML file under \12\TEMPLATE\LAYOUTS\1033 folder. For more information on how to create a custom theme have a look at the following MSDN articles:
http://msdn.microsoft.com/en-us/library/aa979310.aspx
http://msdn.microsoft.com/en-us/library/ms916801.aspx
For a deep dive into the SharePoint CSS customizations go to the best place available on the web:
[...] can read the rest of this blog post by going to the original source, here [...]
Pingback by » Hiding the “Sign in” link in the client web browser — 7 July, 2008 @ 6:43 am
[...] Hiding the “Sign in” link in the client web browser [...]
Pingback by Links (7/8/2008) « Steve Pietrek - Everything SharePoint — 8 July, 2008 @ 11:55 pm