Friday, April 29, 2005

Custom navigation Elements in Portal Header

One of the first things most portal administrators try to do is modify the navigation bar at the top of the default portal page and insert their own links. Although this element appears to be a web part it is actually an ASP.NET server control - compiled code that cannot be modified. You really only have two options if you want to preserve the formatting and layout of the header without sacrificing it's dynamic capabilities: 1) Write your own ASP.NET control to replace it, or 2) Use SPS Areas and some creative HTML to work around it. Since I'm no .NET expert, I'll show you how to do the latter and leave the former up to the real programmers.

Here's how to add a new link within the header navigation:

1. Create a new area and set it's location to 'Home'.
2. Be sure to leave 'exclude from portal site navigation' unchecked.
3. Navigate to the new area.
4. Open the default page in Frontpage 2003.
5. Switch to code view and locate the first 'meta' tag.
7. Insert a meta refresh tag with the appropriate destination URL (click here for an example).
8. Locate the first 'Form' tag.
9. Delete all the code between this tag and the closing Form tag at the end of the page.
10. Save the page back to the portal.

You should see the link for the Area you created in the the header navigation bar. Click on it and it will take you the new default.aspx page which, having been modified to execute an instantaneous redirect, will now take you to the original link.

Hey, it ain't pretty, but it works!!!