Relative path in HTML Fragment Extension Parameters?
Posted: Tue Oct 31, 2023 9:02 pm
I sent this question in to Support and never get a reply so hoping I can crowdsource an answer or workaround:
I have been updating our plugins to move to the latest DITA-OT, and in this version, rather than mucking about in the Oxygen templates, I injected each bit we wanted to add (like code for analytics and links to javascript) using the HTML Fragment Extension Parameters like (in build.xml)
We have come up against a problem though, with the closing_js.xml that is being inserted after the body having relative paths to the js folder, but depending on where the page is inside the help, the static path is not correct (needs a few ../../ for example, if the topic is several layers down). I tried adding ${output.dir} before it, but it didn’t resolve. Is there a way to make these truly relative? Or do you have another suggestion?
contents of closing_js.xml:
Edited to add: Looking for something like "${oxygen-webhelp-assets-dir}/" from the first line , have tried preprending the paths with "${PATH2PROJ}/" and "${output.dir}/", but they are not resolved.
I have been updating our plugins to move to the latest DITA-OT, and in this version, rather than mucking about in the Oxygen templates, I injected each bit we wanted to add (like code for analytics and links to javascript) using the HTML Fragment Extension Parameters like (in build.xml)
Code: Select all
<!-- INJECTING STRINGS INTO FRAGMENTS -->
<property name="webhelp.fragment.head" value="${dita.plugin.com.altair.webhelp.responsive.streamlined.dir}/altair-resources/xml/GA_and_css.xml"/>
<property name="webhelp.fragment.head.topic.page" value="${dita.plugin.com.altair.webhelp.responsive.streamlined.dir}/altair-resources/xml/ZOOMRESTART.xml"/>
<property name="webhelp.fragment.before.body.topic.page" value="${dita.plugin.com.altair.webhelp.responsive.streamlined.dir}/altair-resources/xml/ZOOMSTOP.xml"/>
<property name="webhelp.fragment.after.publication.toc" value="${dita.plugin.com.altair.webhelp.responsive.streamlined.dir}/altair-resources/xml/ZOOMRESTART.xml"/>
<property name="webhelp.fragment.after.feedback" value="${dita.plugin.com.altair.webhelp.responsive.streamlined.dir}/altair-resources/xml/ZOOMSTOP.xml"/>
<property name="webhelp.fragment.after.body" value="${dita.plugin.com.altair.webhelp.responsive.streamlined.dir}/altair-resources/xml/closing_js.xml"/>
<property name="webhelp.fragment.footer" value="${dita.plugin.com.altair.webhelp.responsive.streamlined.dir}/altair-resources/xml/footer_st.htm"/>
<property name="webhelp.fragment.after.logo_and_title" value="${webhelp.prod.version}"/>
Code: Select all
<script src="${oxygen-webhelp-assets-dir}/lib/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="altair-resources/js/bootstrap-toc.js"></script>
<script type="text/javascript" src="altair-resources/js/breadcrumbs.js"></script>
<script type="text/javascript" src="altair-resources/js/splash.js"></script>
<script type="text/javascript" src="altair-resources/js/homepage.js"></script>
<script type="text/javascript" src="altair-resources/js/topics.js"></script>
<script type="text/javascript" src="altair-resources/js/googleAnalytics.js"></script>
<script type="text/javascript" src="altair-resources/js/offlinecheck.js"></script>
<script type="text/javascript" src="altair-resources/js/moreoptions.js"></script>
<script type="text/javascript" src="altair-resources/js/collapsibles.js"></script>
<script type="text/javascript" src="altair-resources/js/version-navigator.js"></script>