Using WebHelp macros in HTML fragments
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 16
- Joined: Mon Apr 23, 2018 8:38 am
Using WebHelp macros in HTML fragments
Hi,
The ability to use WebHelp macros in HTML fragments is a welcome improvement! The instructions on using them, however, are a bit unclear:
https://www.oxygenxml.com/doc/versions/ ... -html.html
The instructions do not reveal that you have to use the element <whc:macro value="${<macro>}"/> if you wish to append a text node to an element. Is the format ${<macro>} only applicable for adding attribute values?
Another question I have is that is it possible to use these macros within inline JavaScript in an HTML fragment? For instance, I'd like to use the WebHelp localization framework in initializing dataTables and using localized UI texts for dataTables based on the output language.
Best regards,
Antti
The ability to use WebHelp macros in HTML fragments is a welcome improvement! The instructions on using them, however, are a bit unclear:
https://www.oxygenxml.com/doc/versions/ ... -html.html
The instructions do not reveal that you have to use the element <whc:macro value="${<macro>}"/> if you wish to append a text node to an element. Is the format ${<macro>} only applicable for adding attribute values?
Another question I have is that is it possible to use these macros within inline JavaScript in an HTML fragment? For instance, I'd like to use the WebHelp localization framework in initializing dataTables and using localized UI texts for dataTables based on the output language.
Best regards,
Antti
-
- Posts: 4
- Joined: Wed Jul 18, 2018 8:56 am
Re: Using WebHelp macros in HTML fragments
Post by Kiyoshirue »
Hello,
I'm also struggling with similar issues related to this very helpful improvement. Thanks for the tips and for posting this, Antti! I'd be highly interested in seeing this go forward.
Many thanks,
Kiyoshirue
I'm also struggling with similar issues related to this very helpful improvement. Thanks for the tips and for posting this, Antti! I'd be highly interested in seeing this go forward.
Many thanks,
Kiyoshirue
-
- Site Admin
- Posts: 275
- Joined: Thu Dec 24, 2009 11:21 am
Re: Using WebHelp macros in HTML fragments
Hello,
Thank you for your feedback. I have submitted a task to our documentation team to update the WebHelp macros related topic in our User Guide.
You are right. You can use the <whc:macro/> component to expand a ${macro} value in a text node.
The <whc:macro/> component can be used in inline JavaScript fragments. For example:
Regards,
Alin
Thank you for your feedback. I have submitted a task to our documentation team to update the WebHelp macros related topic in our User Guide.
You are right. You can use the <whc:macro/> component to expand a ${macro} value in a text node.
The <whc:macro/> component can be used in inline JavaScript fragments. For example:
Code: Select all
<script>
console.log('i18n text: ', '<whc:macro value="${i18n(webhelp.search)}"/>');
</script>
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 16
- Joined: Mon Apr 23, 2018 8:38 am
Re: Using WebHelp macros in HTML fragments
Thank you for your assistance! Also worth noting in the documentation is the fact that you'll need to declare the namespace for the whc: prefix in the root element of the fragment.
Antti
Antti
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