Page 1 of 1

DITA Reusable Components view - Media tab: Insert image with parent fig element?

Posted: Tue May 10, 2022 1:54 pm
by ckabstein
Hi,
It would be helpful if images could also be inserted together with parent <fig> elements. At the moment, only <image> and <xref> can be selected.
Or is there a way that we could make this option available ourselves?
Thanks and best regards,
Christina

Re: DITA Reusable Components view - Media tab: Insert image with parent fig element?

Posted: Tue May 10, 2022 4:45 pm
by adrian_sorop
Hi,

I don't think inserting as <fig> from Media Tab would be possible with a minimium effort. You would have to write you own AuthorExternalObjectInsertionHandler.
Doing this you can control how elements will be inserted when drag'n drop is used.
Here's a documentaion link regarding: https://www.oxygenxml.com/doc/versions/ ... ndler.html

Adding a custom action to the contextual menu of Media tab is not possible.

A more feasible approach would involve a second action.
You insert the image as <image> or <xref>. After the image insertion ends, you invoke your custom action that will change the image to <fig>.
For quick calling this new action, it would have a shortcut or will be placed to a toolbar.

Meanwhile, I've logged an internal issue to add this Insert as figure action to DITA Reusable Components / Media tab.

Let me know if this is usefull for you and if you need help with the code.
Adrian S.

Re: DITA Reusable Components view - Media tab: Insert image with parent fig element?

Posted: Thu Oct 13, 2022 4:34 pm
by adrian_sorop
Hi,
Oxygen version 25.0 was just released.
The Insert as Figure was added to the contextual menu of DITA Reusable Components view.
Regards,
Adrian S.