Getting topic count as a JavaScript variable in WebHelp output
Posted: Wed Apr 29, 2020 4:17 am
Hi,
I'm trying to get the topic count in a map with a custom WebHelp (responsive) publishing template.
I added the markup below to the bottom of the footer template; which I took from
https://github.com/oxygenxml/dita-ot-we ... tom-footer
I tried a couple of variations on the @select value but I always get 0 or 1 totalPages.
I did look into the temp folder but did not find which element I could count().
Can I get the total @topicref in the map from within this template?
What would be the proper @select value?
Thank you,
Raymond
I'm trying to get the topic count in a map with a custom WebHelp (responsive) publishing template.
I added the markup below to the bottom of the footer template; which I took from
https://github.com/oxygenxml/dita-ot-we ... tom-footer
Code: Select all
<script>
totalPages = <xsl:value-of select="count(//*[contains(@class, ' topic/topic ')])"/>;
console.log("totalPages = " + totalPages);
</script>
I did look into the temp folder but did not find which element I could count().
Can I get the total @topicref in the map from within this template?
What would be the proper @select value?
Thank you,
Raymond