How to include the map title as part of the header in HTML5 output

63 views
Skip to first unread message

Jason Davis

unread,
Nov 2, 2017, 2:44:06 PM11/2/17
to DITA-OT Users
Hi all,

I've put together an HTML5 custom plugin and I'm really impressed with how well org.dita.html5 supports customization. One thing I've been banging my head against the wall trying to figure out is how can I process the map title as part of the header on each page. All of my attempts to do this have come up fruitless. I understand the problem: by the time the plugin gets around to generating HTML for each topic, the map is out-of-context. My thinking is that I can set a global variable of sorts that returns the same value no matter what the context. However, I have not figured out to make this happen as in each case the variable basically gets reset to the current context and either returns the current topic title or no value at all. Can anyone share with me how they have solved this problem or explain an approach that I can use? Also, if anyone can explain why my approach doesn't work, that would be great. 

Finally, if this problem has been discussed thoroughly in other threads or venues, please point me in the right direction. I've been combing the interwebs for days now with no luck.

Thanks,
Jason

Eliot Kimber

unread,
Nov 6, 2017, 11:07:35 AM11/6/17
to Jason Davis, DITA-OT Users
The original map is available in the HTML5 XSLT as the variable $input.map

So with that you can easily get any information you want from the map, e.g.

<xsl:apply-templates mode="my-mode-for-making-header-stuff" select="$input.map/*/*[contains(@class, ' topic/title ')]"/>

Cheers,

Eliot

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Eliot Kimber

Jason Davis

unread,
Nov 6, 2017, 12:04:29 PM11/6/17
to DITA-OT Users
Gah it seems so obvious now. Thanks Elliot!
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Eliot Kimber
Reply all
Reply to author
Forward
0 new messages