Page 1 of 1

Change custom action name depending on some event

Posted: Wed Feb 07, 2018 7:42 am
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

Re: Change custom action name depending on some event

Posted: Wed Feb 07, 2018 12:12 pm
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