Page 1 of 1

oxy_editor: editing parent attributes

Posted: Fri Nov 29, 2013 1:24 pm
by Patrik
Hi,

in my dita-derived docmuent type I'd like to ake the attributes @audience, @product and others visible and editable with oxy_popup (provided they are already set). Now in several cases the suitable place for these markers is not right before or after the element but after the first child element. For instance for everything with a title or tablerows. To use oxy_popup there I'd have to set the edit-parameter to "parent::*/@audience" which is currently not working.

An example to display the diff-attribute :

Code: Select all

*[class~="topic/strow"][diff] > *[class~="topic/stentry"]:first-child:after {
font-size: 0.8em;
font-family: "Palatine Linotype", Serif;
content: " (" oxy_xpath("parent::*/@diff") ")";
}
and with the "advanced" oxy_popup it would look like this:
An example to display the diff-attribute :

Code: Select all

*[class~="topic/strow"][diff] > *[class~="topic/stentry"]:first-child:after {
font-size: 0.8em;
font-family: "Palatine Linotype", Serif;
content: " ("
oxy_popup(edit, "parent::*/@diff",
selectionMode, "single",
color, "inherit",
fontInherit, true)
")";
}
It might even be a reasonable extension to your standard dita css!?

Regards,

Patrik

Re: oxy_editor: editing parent attributes

Posted: Fri Nov 29, 2013 3:21 pm
by alex_jitianu
Hello Patrik,

This behavior is not possible right now for the built-in form controls. But this looks like a nice feature so I've added an issue to get it implemented. Until then, a possible workaround for you would be to create custom a form control. If you want I can send you the source code for the built-in pop-up form control so the changes you'll have to do should be fairly minimal. Instead of letting Oxygen do the attribute update on the current element you will have to do the update on the parent element.

More on custom form controls can be found here.

Best regards,
Alex