Variables for document template
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 30
- Joined: Sat May 04, 2019 5:55 pm
Variables for document template
Post by antoterrence »
We have a custom bookmap template that contains references to collections or reusable components. Templates sit in a fixed folder. However, the referenced reusable files are in a variable path. When the user creates a new bookmap using the custom bookmap template, the references are broken. Is there a way to use a variable for the file path?
-
- Posts: 9451
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Variables for document template
Hi,
Inside the DITA Map template's XML content you can use Oxygen editor variables which will be automatically expanded when the end user creates a new file based on the template.
For example you could use something like:
https://www.oxygenxml.com/doc/versions/ ... ables.html
But there is a potential problem, when you use File->New to create a new DITA Map based on the new file template there is a "Save as" field with a checkbox next to it. If the checkbox is checked by the end user and they decide the place on disk where to place the DITA Map and its name, then Oxygen will know how to expand the "${currentFileURL}" editor variable. But if the end user unchecks the "Save as" checkbox Oxygen will create an untitled DITA Map and will no longer know how to expand the "${currentFileURL}" editor variable because the end user has chosen not to save it to disk when creating the content from the new file template.
So you would need to instruct the end user to always use the "Save as" field when creating a new DITA Map from the template and specify a location for the newly created DITA Map.
Regards,
Radu
Inside the DITA Map template's XML content you can use Oxygen editor variables which will be automatically expanded when the end user creates a new file based on the template.
For example you could use something like:
https://www.oxygenxml.com/doc/versions/ ... ables.html
Code: Select all
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>ABC</title>
<topicref href="${makeRelative(${currentFileURL}, ${pdu}/reusables/reusable.dita)}"/>
</map>
So you would need to instruct the end user to always use the "Save as" field when creating a new DITA Map from the template and specify a location for the newly created DITA Map.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 30
- Joined: Sat May 04, 2019 5:55 pm
Re: Variables for document template
Post by antoterrence »
Thank you. I got this to work. In some cases, the expanded path is an absolute path and not a relative path. That will cause potential portability issues.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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