combobox for inserting attribute+value in the current context
Posted: Mon May 23, 2022 9:53 am
If I was creating a code template to create an element and enter the attribute value from the combobox, I would do this:
But what about this use case: I have an existing element and I'd like to create a code template for the Author View that will let the user insert just the attribute @resp into the current element and as its value, the selected value from the combobox. The user is not selecting the element, but their cursor is inside it.
Can I use $xpath_eval in combo with $ask to tell the code template to enter the value of the combobox into the attribute @resp of the current element?
I know I could use form controls and oxy actions for this, but in this particular case, I'd like to see if I can achieve this with a simple code template.
Many thanks in advance — and apologies for asking so many questions these days. But the customization potential of the Author View is so amazing, I'm having too much fun doing all this
All best,
Toma
Code: Select all
<note type="footnote" resp="${ask('message', combobox, ('real_value1':'rendered_value1';'real_valueN':'rendered_valueN'), 'default')}"></note>
Code: Select all
<note type="footnote>blah blah</note>
Can I use $xpath_eval in combo with $ask to tell the code template to enter the value of the combobox into the attribute @resp of the current element?
I know I could use form controls and oxy actions for this, but in this particular case, I'd like to see if I can achieve this with a simple code template.
Many thanks in advance — and apologies for asking so many questions these days. But the customization potential of the Author View is so amazing, I'm having too much fun doing all this

All best,
Toma