Page 1 of 1

Bookmap Template with Standard Topics

Posted: Wed Feb 06, 2019 5:35 am
by jmorales
Hi, I'm new to Oxygen. I'm trying to create a bookmap template that can be used for many of the books we create. I would like this bookmap template to include a link to some standard topics, such as our standard legal notices page. When I create a book based on this template, and I create the book in a different folder than where the template lives, then the topic references in the bookmap get broken. So for instance, the original bookmap template includes the following:
<topicref href="legal_notices.dita"/>
In the bookmap template, this topicref is correct because the legal_notices.dita file is in the same folder as the bookmap template. But when I create a book based on this bookmap template, I create the book in a different folder, and the link to the legal notices topic is broken because of that.

Any suggestions? Thanks!

Re: Bookmap Template with Standard Topics

Posted: Wed Feb 06, 2019 12:33 pm
by sorin_carbunaru
Hello,

In oXygen we have what we call "editor variables" (see https://www.oxygenxml.com/doc/versions/ ... ables.html). What you can do, for example, is to store your legal document in a special folder inside the framework, and then refer it from the template. For example, let's say you store your legal document in oXygen\frameworks\dita\docs. You can then refer it inside the template like this: <topicref href="${framework}/docs/legal_notices.dita"/>, where ${framework} will be expanded to the path (as a URL) of the current framework directory (oXygen\frameworks\dita). Or you can store it in another directory, and use some other editor variable to access it.

All the best wishes,
Sorin Carbunaru
oXygen XML

Re: Bookmap Template with Standard Topics

Posted: Thu Feb 07, 2019 12:37 am
by jmorales
Thank you, Sorin! Your post answered my need perfectly.

I did stumble a little until I learned how to code an absolute path in the variable. The value of the key needs to start with a slash, such as
/C:/Users/johndoe/Documents/ua-sandbox/ua_product_documentation/ua_common/templates

Re: Bookmap Template with Standard Topics

Posted: Thu Feb 07, 2019 10:30 am
by sorin_carbunaru
Did you create your own custom editor variable? It seems so to me...

One more thing: after a discussion with a colleague I reached the conclusion that keeping the legal document relative to the framework is a bad idea, because your project is independent to oXygen. You should probably keep it either relative to your project (and then you can use the ${pd} - project directory - variable in the hrefs) or relative to the root map of your DITA project (and the use ${rootMapDir}).