[oXygen-user] Auto-insert element with cc_config
Oxygen XML Editor Support (Radu Coravu)
support at oxygenxml.com
Wed Oct 12 00:28:17 CDT 2022
Hi Scott,
Welcome to the Oxygen mailing list!
The DITA "Insert image" dialog has a "Figure title" text field. Once you
fill that, it automatically inserts a figure. So what you want may not
be that necessary.
Coming back to what you want, the "cc_config.xml" file does not have the
ability to invoke custom actions in certain contexts.
There are other settings when creating a DITA framework extension which
allow you to remove an item from the content completion window (for
example remove <fig>) and add instead of it a custom Author action with
the same name which may perform other things when invoked:
https://blog.oxygenxml.com/topics/custom-author-action-content-completion.html
For example you can create a custom Author action which inserts an XML
snippet like this in the document:
"<fig><title></title><image href="/${ask('Input URL',
///relative_url/)}/"/></fig>"
Oxygen has support for various editor variables which get expanded when
used in XML snippets:
https://www.oxygenxml.com/doc/versions/24.1/ug-editor/topics/editor-variables.html
This "/{ask('Input URL', ///relative_url/)}/" editor variable would show
a very simple URL chooser, so it does not show the "Insert image" dialog.
If you want to show the "Insert image" dialog, you have the option to
create an Author action which calls a sequence of two or more other
Author actions:
https://blog.oxygenxml.com/topics/composing-author-actions.html
Regards,
Radu
Radu Coravu
Oxygen XML Editor
On 10/11/22 18:07, Scott Prentice wrote:
>
> I've added the following to my cc_config file ..
>
> *<elementProposals path="fig" insertElements="image" />*
>
> This properly inserts an <image> element when a <fig> is added, but
> the Insert Image dialog doesn't display. I tried including
> "insert.image" in the insertElements attribute, but that didn't do the
> trick.
>
> Is it possible to get an image to be added when a fig is inserted, but
> also provide the Insert Image dialog?
>
> Thanks!
> ...scott
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20221012/fd9fa93c/attachment.htm>
More information about the oXygen-user
mailing list