How to update the address bar when TOC is used to navigate?

Topics: DocSites
Nov 19, 2008 at 8:28 PM
So for example, when a user clicks on Programming Guide in the left pane, the address bar changes to:
instead of just displaying

It only shows Default.aspx right now thanks to frames based navigation, but I find that pretty irritating, as you can't really do things like sending links to people easily. And if you happen to click a link in the main documentation pane that causes the address bar to change, it doesn't update to reflect the current topic, so the address bar ends up having nothing to do with what you're actually looking at.

I imagine this could be done by altering the JS that's run when the TOC links are clicked, but I don't know JS well enough to know how to do this offhand.
Nov 19, 2008 at 8:40 PM
I should mention that I'd love for the address bar to update properly when links are clicked in the actual content pane, but that seems a lot more tricky to pull off than just getting the TOC working correctly. The frame based layout is really kind of a pain...
Nov 19, 2008 at 10:30 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Nov 19, 2008 at 10:45 PM
Thanks for the feedback.  I've submitted a workitem ^^ :)

Note that the iframe is a requirement because the files that Sandcastle generates are complete raw .htm files.  There are two alternatives that I had considered when designing the DocSite template but neither of them seemed like a good choice to me:

1. Create a custom Sandcastle presentation style so that .aspx pages are generated instead of .htm pages, with the DocSite stuff already in them.  This approach isn't too bad it's just that the current approach was much easier and faster to develop.  Also, the current approach supports any Sandcastle style, even custom ones, so you are not limited to one particular hard-coded DocSite style.
2. Post-process .htm pages so that they work inside of a div element in the DocSite instead of having to use an iframe.  Then intercept requests for .htm topics and load them into a placeholder control inside of a div.  Again, not too bad if I want to support one style only, such as VS2005, but it couples the DocSite HTML to the HTML that Sandcastle generates and is a lot more work for me to implement.

In a nutshell, having the separation via an iframe frees me of having to care about what Sandcastle produces.  It's also less work for me.

Hopefully the ideas I've expressed in the workitem will be sufficient to meet your needs.

Nov 19, 2008 at 10:49 PM

It may also be worth noting that the Contents pane has its own toolbar with functions such as bookmarking and email, although IIRC they are only visible in Internet Explorer.

- Dave