Keywords

Description

Keyword markers are supported in WebWorks Help 5.0 and no other HTML formats. I would like to have keyword markers working in other HTML formats, such as Dynamic HTML and Microsoft HTML Help 1.x.

Extracting Code from WWHelp

In the meantime, if you don't mind getting your hands dirty, you can add the required code to Dynamic HTML by copying over the necessary implementation bits from WebWorks Help 5.0.

  1. Copy over the required marker type from "pages.fti" into a format override for Dynamic HTML.
       <Class name="marker-type">
        ...
        <Item value="keywords" stringid="keywords" />
        ...
  2. Add the required META element to your "Page.asp" file:
         <meta wwpage:condition="keywords-exist" name="keywords" 
    content="keywords" wwpage:attribute-content="meta-keywords" />
  3. Finally, add the necessary XSL code to collect defined keyword markers from "pages.xsl" (and place in a corresponding format override for Dynamic HTML). Trick is to search for "VarKeywordsMarkers":

         <!-- Keywords Markers -->
         <!--                  -->
         <xsl:variable name="VarKeywordsMarkers" 
    select="$VarSplitBehaviors//wwbehaviors:Marker[@behavior = 'keywords']"
    />
    
    ...
    
           <!-- Keywords? -->
           <!--           -->
           <xsl:if test="count($VarKeywordsMarkers[1]) = 1">
            <wwpage:Condition name="keywords-exist" />
           </xsl:if>
    
    ...
    
           <!-- Keywords -->
           <!--          -->
           <xsl:if test="count($VarKeywordsMarkers[1]) = 1">
            <xsl:variable name="VarKeywordText">
             <xsl:for-each select="$VarKeywordsMarkers">
              <xsl:variable name="VarKeywordMarker" select="." />
    
              <xsl:for-each select="$VarKeywordMarker//wwdoc:Text">
               <xsl:value-of select="@value" />
              </xsl:for-each>
              <xsl:if test="position() != last()">
               <xsl:value-of select="','" />
              </xsl:if>
             </xsl:for-each>
            </xsl:variable>
    
            <wwpage:Replacement name="meta-keywords" 
    value="{$VarKeywordText}" />
           </xsl:if>

That should do it.

BTW: Support can assist with creating overrides in the right place but will not assist with modifying XSL code unless users have purchased customization support.

DevCenter/Projects/Keywords (last edited 2009-09-01 17:13:30 by BenAllums)