Page 1 of 1

create/reuse content component

Posted: Mon Sep 22, 2014 3:35 pm
by dchapman
Hi,

I tried to select the content I want to put in a separate component for reuse using the mouse in Author mode as the instructions say. The content I selected were a number of steps in a task. Although the steps I wanted were highlighted, the end result was a separate component with the entire task body (although I chose /step as the element type in the Reuse Content combo box.

I edited the separate component to get rid of the steps I didn't want. How do I just get the content I highlighted Or is that not possible?

I then tried to insert the reference in another task topic. I can't find the right position for the cursor to insert the reference. Am I supposed to create a step element and place the cursor in that to insert my component? I've tried a bunch of different locations for the cursor and still get an invalid message.

Thanks

Re: create/reuse content component

Posted: Mon Sep 22, 2014 4:58 pm
by dchapman
OK, I see the part about the "ancestor elements of the current element" to quote the Oxygen documentation. So I cannot simply create a reusable component of some steps that I can insert into another task, within other steps that are contained in the <steps></steps> element?

That's what gets inserted into my task, the conref looks like this:

<steps conref="ref_ChooseAffinityAttr#ReusableComponent_dv3_lf1_np/steps_ev3_lf1_np"
id="steps_h2c_451_np">
<step>
<cmd/>
</step>
</steps>

I ignored the warning and inserted into my task just to see what happened. So I basically have a steps element within a steps element in the task I'm trying to use the conref. How granular can I be?

Re: create/reuse content component

Posted: Mon Sep 22, 2014 5:09 pm
by Radu
Hi Dianne,

The Oxygen "Create Reusable Component" action right now it limited to created a reusable component from only one XML element.

In your case, you would like to make a range of DITA steps reusable, this is possible with DITA 1.2.
Here's how you could do this:

You could manually create a DITA task which defines those steps which will later be reused with content like:

Code: Select all

<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="reuseTask">
<title></title>
<shortdesc/>
<taskbody>
<context>
<p></p>
</context>
<steps>
<step id="stepFirst">
<cmd>1</cmd>
</step>
<step>
<cmd>2</cmd>
</step>
<step>
<cmd>3</cmd>
</step>
<step id="stepLast">
<cmd>4</cmd>
</step>
</steps>
</taskbody>
</task>
Then from the task where you want to reuse the steps you should place the caret between existing <step> elements and use Oxygen's Insert DITA Content Reference action to insert a content reference range (the table in the dialog used to insert a conref allows multiple selection so you can select the first and the last step).
The inserted content in the source topic should be something like:

Code: Select all

            <step conref="../topics/reuse.dita#reuseTask/stepFirst"
conrefend="../topics/reuse.dita#reuseTask/stepLast">
<cmd/>
</step>
Regards,
Radu

Re: create/reuse content component

Posted: Mon Sep 22, 2014 6:45 pm
by dchapman
Oh thanks for the quick response! I will try that today and see how it goes. I appreciate the help!