Page 1 of 1

Surround with multiple tags

Posted: Mon Apr 21, 2014 1:40 am
by questpro
In "Author" mode there is function "Surround with Tags..."
Question: is there possibility to surround with multiple tags at once?

For example i have:
"word"
and i want to get
"<sup><span>word</span></sup>"

And another question:
When i use function "Surround with Tags..." it provide me small list with variant such as "element", "img", "table", "cdata", "comment". Does this dialog configurable, can i add tags to surround fast from the dialog?

Re: Surround with multiple tags

Posted: Tue Apr 22, 2014 4:56 pm
by alex_jitianu
Hello,

I think there are two possible solutions to both of your questions:
1. You can create author actions that use the SurroundWithFragmentOperation to specify the elements that will wrap the selection. These actions can be added in the content completion menu or in toolbars and menus. To refer to your example, this author operation will specify as fragment: <sup><span></span></sup> and, as a result, the selection will be wrapped in a sup and a span.
2. You can use the code templates support in Oxygen to define your own code templates. These code templates are basically XML fragments, for example one that handles your sample situation is: <sup><span>${selection}</span></sup>.

Code templates are automatically added in the Content completion menu and will also be presented in the list of elements from action Surround with Tags.... If you go with author actions instead, if you add them in the content completion menu, they will also be presented inside Surround with Tags....

Best regards,
Alex