Controlling <topichead> behaviour in the HTML output
Post here questions and problems related to editing and publishing DITA content.
Controlling <topichead> behaviour in the HTML output
In a HTML output, when you click on a <topichead> entry in the side TOC, the TOC node with the <topichead> expands and the content/output for the first nested child topic is shown.
This is a welcome and expected behaviour, I would just love to know which exact setting/configuration controls that.
This is a welcome and expected behaviour, I would just love to know which exact setting/configuration controls that.
-
- Posts: 128
- Joined: Mon Jun 12, 2017 10:50 am
Re: Controlling <topichead> behaviour in the HTML output
Post by cosmin_andrei »
Hi Bas10R,
Indeed, this is the intended behavior and it is not configurable.
Indeed, this is the intended behavior and it is not configurable.
Regards,
Cosmin
--
Cosmin Andrei
oXygen XML Editor and Author Support
Cosmin
--
Cosmin Andrei
oXygen XML Editor and Author Support
Re: Controlling <topichead> behaviour in the HTML output
Thank you, Andrei!
If it's not configurable, could you please let me know what controls this behaviour (DITA OT, Oxygen's transformation scenario, or something different)?
I'm looking to implement a similar user experience in a non-DITA format, so I'm grasping for tips here!
If it's not configurable, could you please let me know what controls this behaviour (DITA OT, Oxygen's transformation scenario, or something different)?
I'm looking to implement a similar user experience in a non-DITA format, so I'm grasping for tips here!
-
- Posts: 128
- Joined: Mon Jun 12, 2017 10:50 am
Re: Controlling <topichead> behaviour in the HTML output
Post by cosmin_andrei »
Hi,
This is implemented in the internal XSLT stylesheets of the WebHelp Responsive plugin where a link to the first descendant is added.
This is implemented in the internal XSLT stylesheets of the WebHelp Responsive plugin where a link to the first descendant is added.
Regards,
Cosmin
--
Cosmin Andrei
oXygen XML Editor and Author Support
Cosmin
--
Cosmin Andrei
oXygen XML Editor and Author Support
Re: Controlling <topichead> behaviour in the HTML output
Hello,
In the Publication TOC, the value for the href attribute of the nodes corresponding to <topichead> elements is computed in the computeHrefAttr XSL template (line 415) in {DITA_OT_DIR}\plugins\com.oxygenxml.webhelp.responsive\xsl\navLinks\sidetoc.xsl:
The DITA-OT bundled in Oxygen XML Editor is located in:
{OXYGEN_INSTALL_DIR}\frameworks\dita\DITA-OT3.x\
Note that the above XSL file is applied over the toc.xml file generated in the temporary directory of the WebHelp Responsive transformation.
We use the $VOID_HREF value to mark the nodes that do not have a value set for the @href attribute in the DITA map. The assignment of the $VOID_HREF value is performed in the {DITA_OT_DIR}\plugins\com.oxygenxml.webhelp.responsive\xsl\navLinks\tocDitaImpl.xsl at line 172:
Note, that the above stylesheet is applied over the DITA map file (.ditamap) from the temporary directory of the WebHelp transformation.
Regards,
Alin
In the Publication TOC, the value for the href attribute of the nodes corresponding to <topichead> elements is computed in the computeHrefAttr XSL template (line 415) in {DITA_OT_DIR}\plugins\com.oxygenxml.webhelp.responsive\xsl\navLinks\sidetoc.xsl:
Code: Select all
<xsl:template name="computeHrefAttr">
<xsl:choose>
<xsl:when test="@href and @href != $VOID_HREF">
<xsl:value-of select="@href"/>
</xsl:when>
<xsl:otherwise>
<!-- EXM-38925 Select the href of the first descendant topic ref -->
<xsl:value-of select="descendant::toc:topic[@href and @href != $VOID_HREF][1]/@href"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
{OXYGEN_INSTALL_DIR}\frameworks\dita\DITA-OT3.x\
Note that the above XSL file is applied over the toc.xml file generated in the temporary directory of the WebHelp Responsive transformation.
We use the $VOID_HREF value to mark the nodes that do not have a value set for the @href attribute in the DITA map. The assignment of the $VOID_HREF value is performed in the {DITA_OT_DIR}\plugins\com.oxygenxml.webhelp.responsive\xsl\navLinks\tocDitaImpl.xsl at line 172:
Code: Select all
<xsl:attribute name="href">
<xsl:choose>
<xsl:when
test="@copy-to and not(ancestor-or-self::*[contains(@chunk, 'to-content')])">
<xsl:call-template name="replace-extension">
<xsl:with-param name="filename" select="@copy-to"/>
<xsl:with-param name="extension" select="$OUT_EXT"/>
<xsl:with-param name="forceReplace"
select="not(@format) or @format = 'dita'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@href">
<xsl:call-template name="replace-extension">
<xsl:with-param name="filename" select="@href"/>
<xsl:with-param name="extension" select="$OUT_EXT"/>
<xsl:with-param name="forceReplace"
select="not(@format) or @format = 'dita'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$VOID_HREF"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service