Side-Entry to HTML tocjs Documnet
Self on Help
Thoughts from the OASIS DITA Help Subcommittee Chair
A question was raised recently on the Yahoo! DITA Users mailing list relating to linking via a URL to a specific page in a collection of HTML. The requirement was for the target page to open within the "tri-pane" frameset so that the table of contents was visible.
A number of solutions were mooted, but Martin Polley eventually came up with a solution to fitted the particular requirement (but not necessarily all requirements).
Martin added a function to the top-level frameset of the collection. The function contained the following code:
var query = window.location.search.substring(1);
if query {
document.getElementById('contentwin').src=query;
}
Translated, this function reads the querystring of the URL to work out which specific page is meant to display, and then drives that page into the content area frame (named contentwin). If the query string is empty, then it doesn't bother doing anything.
The URL of the frameset normally might be:
http://example.com/index.html
but to load a specific topic, the URL might be:
http://example.com/index.html?concepts/overview.html.
It is also possible to approach the problem from the opposite direction, which was suggested by Shawn McKenzie. This would involve just linking the URL of the target topic, and having a JavaScript in that page reloading the page within the frameset page.
Great ideas, and something that would be good to have built-in to the plug-ins concerned!