Bookmap Template with Standard Topics

jmorales
Posts: 15
Joined: Tue Oct 30, 2018 9:47 pm

Bookmap Template with Standard Topics

Post by jmorales » Wed Feb 06, 2019 5:35 am

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!

sorin_carbunaru
Site Admin
Posts: 228
Joined: Mon May 09, 2016 9:37 am

Re: Bookmap Template with Standard Topics

Post by sorin_carbunaru » Wed Feb 06, 2019 12:33 pm

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

jmorales
Posts: 15
Joined: Tue Oct 30, 2018 9:47 pm

Re: Bookmap Template with Standard Topics

Post by jmorales » Thu Feb 07, 2019 12:37 am

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

sorin_carbunaru
Site Admin
Posts: 228
Joined: Mon May 09, 2016 9:37 am

Re: Bookmap Template with Standard Topics

Post by sorin_carbunaru » Thu Feb 07, 2019 10:30 am

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}).

Post Reply