Change custom action name depending on some event

Post here questions and problems related to oXygen frameworks/document types.
pramanikhimangshu
Posts: 17
Joined: Fri Dec 29, 2017 11:16 am

Change custom action name depending on some event

Post by pramanikhimangshu »

Hi,

I have a custom action dita framework to create a link and it modifies the link if selection is already link.
I want to change the display name of the action in context menu. In normal case it will display "Link..." and when the selection is already a link it should display "Modify Link..." in the context menu.

Any help how to do this..

Thanks.
Regards,
Himangshu
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: Change custom action name depending on some event

Post by sorin_carbunaru »

Hello Himangshu,

Unfortunately, changing the action's name based on the context is not possible. But I thought about a workaround that might interest you...

Instead of having one action that does 2 different things, you could have 2 separate actions, with their own names (let's say "Insert Link" and "Edit Link") and their own activation XPath expressions. The XPath expressions must be written in such a way that these 2 action will never be both active at the same time. And when one of them is not active, it won't even be rendered in the contextual menu. So, if you have both actions next to each other in the contextual menu, but only one of them is rendered at a given time, then for the user it will look like there is only one action that changes its name when the position in the document is changed.

Regards,
Sorin Carbunaru
oXygen XML
Post Reply