If you've ever tried to add a named anchor hyperlink in a MOSS/SharePoint Wiki page, you'll find that the SharePoint rich text editor does not support adding named anchors (hyperlinks to areas in the same HTML document) via the toolbar buttons (you'll get an error dialog). I was able to find one workaround here, but it didn't quite suit my needs. Following is possibly an easier workaround using root relative urls. To get this functionality, you first need to switch to source view and add some html code by hand.
Add Anchors
Click the source button to switch to HTML source view. Add your anchor wherever you need it in the source, for example:
<a id=”nameofanchor” name=”nameofanchor”></a>
When done adding anchors, click OK to go back to the rich text view.
Linking to Anchors
To create links to the anchors you just created, you can do this easily from the rich text toolbar by clicking on the Hyperlink button.
In the Hyperlink dialog, for the Address, specify the root relative URL for the page, in the following format:
/firstsubsite/secondsubsite/wiki page library name/Name of Wiki Page.aspx#nameofanchor
You can get this url by going out of edit mode on the page, and back to viewing the page in regular view mode.
- Copy the URL from the address bar
- Remove the first domain name part of the URL (e.g. http://domain.com)
- Add the named anchor portion (e.g. #nameofanchor) to the very end of the url.
Posted
10-31-2007 11:29 AM
by
adamtoth