Tuesday 13 May 2008

Making SharePoint Help More Context Sensetive

You can perform more advanced customization of the Help system. For example, each default page has one or more unique Help topics associated with it. These associations are maintained in a table in the Help ASPx home page. By editing this table, you can make your custom Help topics appear in the list of context-sensitive topics for a particular page in your Web site. For more information about advanced customization of Help, see the Microsoft Windows SharePoint Services Software Development Kit.

References
http://lblstrategies.sharepointsite.com/_vti_bin/help/1033/sts/html/wsaextr8.htm
http://ragavj.blogspot.com/2007/04/custom-help-window-can-be-opened-by.html

This method is most suitable when attempting to “take over” the Help link on all Area AND Site pages.

In the ows.js file (located at \\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033), there is a JavaScript function called HelpWindowHelper(). It is below:

function HelpWindowHelper(strParam){ var strHelpUrl; if (strParam == "") strHelpUrl = "/_layouts/" + L_Language_Text + "/help.aspx" + "?LCID=" + L_Language_Text; else strHelpUrl = "/_layouts/" + L_Language_Text + "/help.aspx" + strParam + "&LCID=" + L_Language_Text; var wndHelp = window.open(strHelpUrl, "STSHELP", "width=270,height=500,menubar,scrollbars,toolbar,resizable"); wndHelp.focus();}

All SharePoint-based Help links run through this function. SharePoint is actually smart enough to pass a parameter telling the function where it came from and allows it to pop up page specific help. I altered this function to change the 'window.open' line to go to my help file (in our case, we actually used a WSS site with tabs for various help topics; you could also use simple HTML).
var wndHelp = window.open(“http://...my help page..“, "STSHELP", "width=270,height=500,menubar,scrollbars,toolbar,resizable");

With this one line change, all SharePoint help links pop up our custom help page!

Lets say you didn't want to lose the valuable targeted help pages. For example, if someone is adding a listing, and clicks help, then they probably want the targeted help that SharePoint provides. But at the top level of an area, if a user clicks help, they probably want our general "Help" site. This is how I handled it. I wrapped the original window.open call with the following: if (strParam.toLowerCase() == "?key=helphome") { strHelpUrl = "http://it/SharePointHelp/default.aspx%22 var wndSPSHelp = window.open(strHelpUrl, "SPSHELP"); wndSPSHelp.focus(); } else { // Original code var wndHelp = window.open(strHelpUrl, "STSHELP", "width=270,height=500,menubar,scrollbars,toolbar,resizable"); wndHelp.focus(); } That way, any page that would go to the SharePointHelp.htm home page, would go instead to our SharePoint site's help page. There is an exception, however. Some context-sensitive topics don't have help pages.

For example, "Manage Users". If you click help there, it passes the context in, but help.aspx doesn't find a topic, and so it sends the user to the help home page. So I added a prominent new link on that home help page to point to our SharePoint site help:

General Help:


http://it/SharePointHelp/default.aspx">
SharePoint Resources


Reference: http://blogs.officezealot.com/mauro/archive/2005/01/15/3857.aspx

No comments:

Zootmastaflex

Zootmastaflex
The Queen of RockStars!