Relative path in HTML Fragment Extension Parameters?
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 32
- Joined: Wed Aug 16, 2017 8:07 pm
Relative path in HTML Fragment Extension Parameters?
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?
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}"/>
image.png
contents of closing_js.xml:
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>
You do not have the required permissions to view the files attached to this post.
-
- Posts: 38
- Joined: Fri Jan 22, 2021 11:05 am
Re: Relative path in HTML Fragment Extension Parameters?
Post by beniamin_savu »
Hi,
Please note that we replied to your email on October 26.
The email may have ended-up in your Spam/Junk folders, so we suggest to double check those ones too.
If you cannot find our email at all, then you should reach to the system administrator in your company, as they may be using third party spam filtering software deployed in your company email, which incorrectly considers the emails from us as spam and filters them from reaching your inbox.
In the email we also attached a zip file containing a publishing template example. It could be possible that your email server blocks emails that contain attachments?
I will copy the message from the email sent on October 26:
* oxygen-webhelp-output-dir - The path to the output directory. The path is relative to the current HTML file.
* oxygen-webhelp-assets-dir - The path to the oxygen-webhelp subdirectory from the output directory. The path is relative to the current HTML file.
* oxygen-webhelp-template-dir - The path to the template directory. The path is relative to the current HTML file.
More details can be found using the following link: https://www.oxygenxml.com/doc/versions/ ... -html.html
Best regards,
Beniamin Savu
Oxygen WebHelp Team
http://www.oxygenxml.com
Please note that we replied to your email on October 26.
The email may have ended-up in your Spam/Junk folders, so we suggest to double check those ones too.
If you cannot find our email at all, then you should reach to the system administrator in your company, as they may be using third party spam filtering software deployed in your company email, which incorrectly considers the emails from us as spam and filters them from reaching your inbox.
In the email we also attached a zip file containing a publishing template example. It could be possible that your email server blocks emails that contain attachments?
I will copy the message from the email sent on October 26:
The Publishing Template sample can be obtained from the follwoing link:To customize the WebHelp Responsive output we recommend to use the Publishing Templates. More details about the Publishing Templates can be found using the following links:
https://www.oxygenxml.com/doc/versions/ ... plate.html
https://www.oxygenxml.com/doc/versions/ ... llery.html
https://www.oxygenxml.com/doc/versions/ ... tents.html
Using the publishing template you can create the altair-resources/js folder structure and add all your js files in that folder. You can also have a folder named html-fragments where you will have all the html-fragments files. Your publishing template should look something like this:dRiLbL0PWZ2NUKvd.pngIn the publishing template descriptor file (the .opt file) you will need to specify that the files inside the altair-resources folder should to be copied to the output folder. Also you will need to specify the HTML fragment to inject in the output pages using the <html-fragment> element.xE6BoTefjLk7qEJj.pngUsing the Publishing Template you can set all the transformation parameters that you need in the <parameters> element. Also you can use the Publishing Template to insert all you HTML fragments. In this sample Publishing Template I showcased how to insert only one fragment.
I attached this sample publishing template that inserts the js files at the end of the body for every HTML page in the WebHelp Responsive output. The js files only print some messages in the browser console. Running the WebHelp Responsive transformation with this publishing template you will see that the JavaScript files are executed on every page of the output. You can use it to further customize it according to your needs.
altair-template-example.zip
WebHelp Responsive offers the possibility to insert specific macros when inserting custom content using the HTML fragments. For example:* oxygen-webhelp-output-dir - The path to the output directory. The path is relative to the current HTML file.
* oxygen-webhelp-assets-dir - The path to the oxygen-webhelp subdirectory from the output directory. The path is relative to the current HTML file.
* oxygen-webhelp-template-dir - The path to the template directory. The path is relative to the current HTML file.
More details can be found using the following link: https://www.oxygenxml.com/doc/versions/ ... -html.html
Best regards,
Beniamin Savu
Oxygen WebHelp Team
http://www.oxygenxml.com
You do not have the required permissions to view the files attached to this post.
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 JSON Editor
- ↳ 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