Suggestion: Customize the running header text

Topics: Developer Forum, Project Management Forum, User Forum
Mar 15, 2008 at 5:01 AM
Edited Mar 15, 2008 at 5:23 AM
I was working on adding additonal content to my project when it occurred to me that I would like the running header text (which maps to the HelpTitle property) to reflect the TOC root entries for the different groups of additional content. So, in the default transform (in this case, VS2005.xsl) I added this:

<!-- Variable added to the default additional content transform within the <body> tag before the first <div> tag -->

<xsl:variable name="customHeader">
<xsl:choose>
<xsl:when test="headerTitle">
<xsl:value-of select="headerTitle"/>
</xsl:when>
<xsl:otherwise>
<@HtmlEncHelpTitle/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

Then, make this change in the first table:

<div id="header">
<table id="bottomTable" cellpadding="0" cellspacing="0">
<!-- Include the logo if present -->
<xsl:if test="logoFile">
<xsl:apply-templates select="logoFile"/>
</xsl:if>
<tr id="headerTableRow1">
<!-- The product title is replaced with the project's HTML encoded HelpTitle value -->

<!-- Change the value of "runningHeaderText" to this -->
<td align="left"><span id="runningHeaderText"><xsl:value-of select="$customHeader"/></span></td>

</tr>

And used a <headerTitle> tag in the .topic files, like these two:

<!-- Sample .topic files with custom running headers corresponding to TOC root entries -->

<topic xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<!-- The page title -->
<title>MyCoolControl Overview</title>
<!-- Optional tag for a custom running header -->
<headerTitle>MyCoolControl Developer's Guide.</headerTitle>
<!-- Add a logo -->
<logoFile filename="images/Sandcastle.jpg" altText="Test logo"
placement="left" alignment="left" />
<!-- HTML Help 2.x data island -->
<xml xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<MSHelp:Attr Name="AssetID" Value="Test" />
<MSHelp:Keyword Index="A" Term="IndexTerm" />
<MSHelp:Attr Name="TopicType" Value="apiref" />
<MSHelp:Attr Name="TopicType" Value="kbSyntax" />
<MSHelp:Attr Name="Locale" Value="en-us"></MSHelp:Attr>
<MSHelp:Attr Name="Abstract" Value="An abstract for the file" />
</xml>
<!-- The body text for the topic -->
<bodyText>
This is the <b>body text</b> for the additional content page.
</bodyText>
</topic>



<topic xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<!-- The page title -->
<title>Using MyCoolControl on Mondays</title>
<!-- Optional tag for a custom running header -->
<headerTitle>MyCoolControl Tutorial</headerTitle>
<!-- Add a logo -->
<logoFile filename="images/Sandcastle.jpg" altText="Test logo"
placement="left" alignment="left" />
<!-- HTML Help 2.x data island -->
<xml xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<MSHelp:Attr Name="AssetID" Value="Test" />
<MSHelp:Keyword Index="A" Term="IndexTerm" />
<MSHelp:Attr Name="TopicType" Value="apiref" />
<MSHelp:Attr Name="TopicType" Value="kbSyntax" />
<MSHelp:Attr Name="Locale" Value="en-us"></MSHelp:Attr>
<MSHelp:Attr Name="Abstract" Value="An abstract for the file" />
</xml>
<!-- The body text for the topic -->
<bodyText>
This is the <b>body text</b> for the additional content page.
</bodyText>
</topic>

I'm not sure if it ought to be included in the next release, as the implementation is trivial, and the whole point of a default pattern is that it be lightweight. But, nevertheless, I thought I would share.
Coordinator
Mar 15, 2008 at 10:40 PM
Thanks. It was a minor change so I've added it. I made the variable global so that it works with the logo option too which changed in 1.6.0.5 to support the placement options.

Eric
Mar 16, 2008 at 5:47 PM
Cool. I don't suppose you know anything about when the February 2008 CTP (although Anand is not using the CTP model anymore) is supposed to be released? It appears to address several issues with the VS2005 style that I would like to see.

Thanks.

Mark
Coordinator
Mar 16, 2008 at 8:34 PM
Edited Mar 17, 2008 at 2:44 AM
I'm not sure when the next release is due out. I'll send Anand an e-mail and see what's up.

EDIT: The reply from Anand suggests that the next release will be some time in April.

Eric