Page 1 of 1

Most generic container element?

Posted: Fri Jun 17, 2016 11:30 am
by anonymous1
Hi,

I am creating some reusable topics and these topics can contain anything: sections, li, you name it.
Then I have a set of topics that will pull content from the topics I mentioned above.

By script I add a conref to these, and every time I do this, I need all the content of the reusable topic pulled in my topic. So I need to link to the parent element, or wrapper.

So here is an example.

Reusable topic:

Code: Select all

<topic id="D777">
<title>something</title>
<body>
<div id="d2e80362">
<section>
<ul>
<li>some li</li>
<li>some li</li>
</ul>
</section>
</div>
</body>
</topic>
And a topic that pulls the other one in:

Code: Select all

<task id="D254875">
<title>Whatever</title>
<shortdesc>blabla.</shortdesc>
<taskbody>
<prereq>
<p>Make sure you blabla.</p>
<div conref="reuse/D254126.dita#D777/d2e80362"/>
</prereq>
...
</task>

So my question is: I need to wrap the content of my reusable topic into an element that will fit almost everywhere where it is pull-in.
I have tried div like in the example, conbody, refbody, section but it seems there is often a catch to these elements.

I don't expect to be able to use my reusable topics in <step> elements as they are naturally very specific, but what can I use as a wrapper to always be valid below a <body> element for example? Is there anything more generic than <div>?

Thank you!

Re: Most generic container element?

Posted: Fri Jun 17, 2016 11:53 am
by Radu
Hi Arthur,

I do not quite understand your example.
You define an ID on a <div> element and then you conref to it using a <section> element. The element which makes the conref should be the same element with the conreffed element (the element which has the ID).
About your question, I think that div and ph are the most versatile elements. You can also register on the Yahoo Groups DITA Users List and ask there if you want to know more opinions.

Regards,
Radu

Re: Most generic container element?

Posted: Fri Jun 17, 2016 12:11 pm
by anonymous1
Hi Radu,

Sorry, I first edited my example with a section element that I replaced with a div and forgot to edit it in the conref.

Ok, so if the div element is most generic, then I'm going to have to think of a work around to make it work for each reused topic.

Thank you, I'll go take a look in Yahoo Groups.