Page 1 of 1

delete action in toolbar

Posted: Tue Mar 18, 2025 12:19 pm
by ArthurP
Hi,

I'm trying to remove two actions from the toolbar. These actions are : insert a keyref and insert a conref.
In framework file.exf, I added the followling lines but actions are still here.

Code: Select all

<removeAction id="insert_reusable_component"/>
<removeAction id="insert.conkeyref"/>
Could you provide some help ? Thanks

Regards,
arthur

Re: delete action in toolbar

Posted: Wed Mar 19, 2025 12:55 pm
by cosminef
Hello,

Sorry for the delayed reply.
Can you show us through a screenshot the exact actions you want removed from the toolbar?

Best,
Cosmin

Re: delete action in toolbar

Posted: Wed Mar 19, 2025 1:16 pm
by ArthurP
Hi Cosmin,

These are the two buttons
buttons.png
Regards,
arthur

Re: delete action in toolbar

Posted: Wed Mar 19, 2025 2:56 pm
by cosminef
Hello,

For this action:
Conref16@2x.png
the correct id is: "reuse.content" ; so in you exf file you have to use:

Code: Select all

<removeAction id="reuse.content"/>
For the other action the correct id is: "DITA/ReuseKeys" but in this case you already have an issue registered in our internal system - WA-8101 - "Removing the toolbar action "Insert links and variables defined in DITA keys" through an exf file doesn't work".
As a workaround you have to enter this field in your exf file:

Code: Select all

<webResources inherit="all">
    <addEntry path="${frameworkDir}/removeDITAReuseKeysAction.js" position="before"/>
 </webResources>
and in the removeDITAReuseKeysAction.js file looks like this:

Code: Select all

sync.ext.Registry.extension.registerActionsHandler(function(editor, actionsConfig) {
      setTimeout(() => {
        workspace.currentEditor.getActionsManager().unregisterAction('DITA/ReuseKeys');
        workspace.currentEditor.getActionsManager().refreshActionsStatus();
    });
  });
Best,
Cosmin

Re: delete action in toolbar

Posted: Wed Mar 19, 2025 4:26 pm
by ArthurP
Thanks Cosmin, it work like a charm.
The two buttons are successfully removed.

Regards,
arthur