Relative path for conref in templates
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 16
- Joined: Sat May 30, 2015 2:18 am
Relative path for conref in templates
Our templates are in a /doc/resource/templates folder. We want to include conrefs in the template that won't break no matter where we create files with the template. For example, we typically create files under a /doc/source/product folder and we want to conref text in a /doc/source/common folder.
How can we make this work with the ${makeRelative(base,location)} variable? I've tried using ${currentFileURL} as base with a variety of other variables as location but I can't get this to work. What exactly is base and what is location? Is there something else that I should be doing?
How can we make this work with the ${makeRelative(base,location)} variable? I've tried using ${currentFileURL} as base with a variety of other variables as location but I can't get this to work. What exactly is base and what is location? Is there something else that I should be doing?
-
- Posts: 9451
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Relative path for conref in templates
Hi Julie,
Usually in such cases as you are using DITA I would suggest you use conkeyrefs instead of conrefs, this would ensure you do not have file path dependent references in your new file templates.
But indeed using the "makeRelative" is another option. The first parameter is the URL path to the current created file template, so it should be "${currentFileURL}". The second parameter should be the URL path to the file containing the reusable content, so it should be something like "${pdu}/reusables/reusable.dita#topicID/elementID".
If you create the new file based on the template using the "File->New" wizard dialog, at the bottom of the dialog there is a "Save as" field. You need to check that and decide on a location for the newly created file, otherwise the "${currentFileURL}" will not be properly expanded as the newly created file is not yet saved on disk.
If this will not work for you I will try to create a sample project on my side and send it over.
Regards,
Radu
Usually in such cases as you are using DITA I would suggest you use conkeyrefs instead of conrefs, this would ensure you do not have file path dependent references in your new file templates.
But indeed using the "makeRelative" is another option. The first parameter is the URL path to the current created file template, so it should be "${currentFileURL}". The second parameter should be the URL path to the file containing the reusable content, so it should be something like "${pdu}/reusables/reusable.dita#topicID/elementID".
If you create the new file based on the template using the "File->New" wizard dialog, at the bottom of the dialog there is a "Save as" field. You need to check that and decide on a location for the newly created file, otherwise the "${currentFileURL}" will not be properly expanded as the newly created file is not yet saved on disk.
If this will not work for you I will try to create a sample project on my side and send it over.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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