Hello Graham,
If you are setting your fragment directly as parameter value, then that fragment should be a
well-formed XML fragment. In your case you should have declared the XML namespace for the
whc prefix, that is:
Code: Select all
xmlns:whc="http://www.oxygenxml.com/webhelp/components"
If you are using an HTML Fragment file, then that file should be
XML well-formed. In your case, the content should have a single root element and it should also contain the namespace declaration mentioned above.
You can read more about HTML Fragment Extension Points here
https://www.oxygenxml.com/doc/versions/ ... aid-title6
There are two possibilities for using macros:
- Directly in attribute values - For example, if you want to reference a JavaScript file from the Publishing Template directory, you can use the following construct:
Code: Select all
<script type="text/javascript" src="${path(oxygen-webhelp-template-dir)}/"></script>
- In text content - Using the <whc:macro> template component:
Code: Select all
<script type="text/javascript" xmlns:whc="http://www.oxygenxml.com/webhelp/components">
var outDirPath = '<whc:macro value="${path(oxygen-webhelp-output-dir)}"/>';
console.log("The output directory path is:", outDirPath);
</script>
...so I thought I'd try an external fragment file:
<parameter name="webhelp.fragment.footer" value="html-fragments/webhelp_fragment_footer.html"/>
When referencing an HTML Fragment file inside the Publishing Template's descriptor file (.opt) I would recommend to use the dedicated section (inside the <html-fragments> element).
If you want to use the <parameters> section you should instruct the Publishing Template that the parameter's value represents a relative file path by setting the @type="filePath" attribute on the <parameter> element.
I've tried specifying an absolute path, rather than a relative path, for the value attribute.
I would not recommend referencing absolute file paths in the descriptor file because the Publishing Template is considered to be a self contained customization package that can be shared with others.
Regards,
Alin