Skip to main content
PMYM
Inspiring
January 31, 2019
Answered

Problem with reusable paragraphs

  • January 31, 2019
  • 1 reply
  • 626 views

Hi

What I try to do?

- I wan't to create a "library" file where I list terms like product name which can change between projects. Then I reuse these paragraphs in my files and I have to update only this one file when the project changes. I would use the same idea for the warnings and notes as well.

How I have done it?

- I created topic MyVariables.xml and included <ph> element for product name. I added id product_name for the element.

- In the file which is used in my ditamap I added <ph> and added to conref attribute MyVariables.xml#shared/product_name (I found this "shared" from some web discussion")

Result?

- As long as all the files are located in the same folder it works as wanted.

Problem?

- I would like to have is a possibility to keep files in different folders so that those could be grouped logically, not to have dozens of files in one folder. I haven't found how this could be done. I found an instruction to add folder path to conref but there was not instruction how to do it (and I do it wrong as it is not working).

Any advice?

Br,

Pekka

This topic has been closed for replies.
Correct answer PMYM

The solution was keyspace. I had tried it earlier but in a wrong way. After creating the keyspace I referred to the element by adding the element to my concept and setting the attribute conref to refer to the wanted paragraph.

I was told to use the selection Insert - Conref. And it is working.

1 reply

PMYM
PMYMAuthor
Inspiring
January 31, 2019

Other way I have tested:

Map:

<map xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/">

<title>MY TEST MAP</title>

<keydef href="MyTestingVariables2.xml" keys="ReuseTest"

    type="topic">

<topicmeta>

<navtitle>MyTestVariables2</navtitle>

</topicmeta>

</keydef>

<topicref href="My test concept.xml" type="concept">

<topicmeta>

<navtitle>My test concept</navtitle>

</topicmeta>

</topicref>

</map>

Concept:

<concept id="id191VCE00GY4"

    xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/">

<title>My test concept</title>

<shortdesc>Only for testing</shortdesc>

<prolog>

<author></author>

</prolog>

<conbody>

<p>The name of the product is

<ph

    conref="ReuseTest/ProductName"></ph>

</p>

</conbody>

</concept>

Topic (Including the reusable content):

<topic id="id191VF300W5Z"

    xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/">

<title>MyTestVariables2</title>

<shortdesc>For testing only</shortdesc>

<prolog>

<author></author>

</prolog>

<body>

<p>

<ph id="ProductName">Test product</ph>

</p>

</body>

</topic>

PMYM
PMYMAuthorCorrect answer
Inspiring
February 6, 2019

The solution was keyspace. I had tried it earlier but in a wrong way. After creating the keyspace I referred to the element by adding the element to my concept and setting the attribute conref to refer to the wanted paragraph.

I was told to use the selection Insert - Conref. And it is working.