Re: Confused with Profiling and Ditaval #Oxygen #reuse


John Piechowski
 

We use option 2, an image topic that we add into our ditamap as a key.

John

On Sun, May 31, 2020, 12:28 AM Radu Coravu <radu_coravu@...> wrote:

Hi Matt,

When it comes to reusing images using keys there are two possible approaches:

1) Create a DITA map named something like "imageKeys.ditamap" with lots of keydefs like:

 <keydef keys="image1" href="image1.png" format="png"/>
  <keydef keys="image2" href="image2.png" format="png"/>
Refer to this "imageKeys.ditamap" in the main product.ditamap.

From each topic use:

<image keyref="imageKey"/>
to refer to images.

2) Create an "images.dita" topic which lost of image references, each image reference with an @id.

The content of the "images.dita" would look like:

<topic id="images">
    <title>Images</title>
    <body>
        <image href="image1.png" alt="image 1 text" id="image1"/>
        <image href="image2.png" alt="image 2 text" id="image2"/>
.........
    </body>
</topic>
The "images.dita" would be referenced in the main product.ditamap as a resource only topic so that it does not appear in the output and assigned a key:
<keydef keys="images" href="images.dita"/>
and then each topic would use conkeyefs to refer to images like:

<image conkeyref="images/image1"/>

Approach (2) does have certain upsides, you can reuse also the image alternate texts. You can also reuse also entire <fig> figure elements.


Regards,

Radu

Radu Coravu
Oxygen XML Editor
On 5/29/20 11:14 PM, Matt Lorenzi via groups.io wrote:

So looks like there's a few avenues here. So rather a a master topic for the image, I'd create one for each image? That would resolve the single sourcing issue, but less so if I want to reuse the text and image in another map -  would always have to make sure I grabbed both topics. 

So I could use a keyref for the image placeholder, then call up the image in my map? Is that what you mean Radu? Is there more scripting involved than you you provided above? I'm oddly excited to try this.



  

Join main@dita-users.groups.io to automatically receive all group messages.