To have both text field,check box for an element

Post here questions and problems related to editing and publishing DITA content.
Raga Mounika
Posts: 49
Joined: Mon Mar 28, 2016 3:54 pm

To have both text field,check box for an element

Post by Raga Mounika »

Hi Team,

I need to work on CSS changes for a new GUI.
Consider <image> element.I should have both the attributes scale and scalefit for this.
In scale I used oxy_textfield where as in scalefit I used oxy_checkbox.When an <image> is inserted it should have both the attributes(scale,scalefit)I am getting only checkbox here( text field is not coming).
And on selection of any these attributes the other one should diasappear.
Example: If I enter 10 in scale text field, checkbox should disappear and vice versa.

Please help me in resolving this issue.

Thanks and Regards,
Mounika
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: To have both text field,check box for an element

Post by alex_jitianu »

Hi Mounika,

You should be able to control this behavior through CSS rules. I don't know how the rules you've tried look like but here are some CSS rules that I believe work as you desire:

Code: Select all

*[class~="topic/image"]:before {
content: "Scale: " oxy_textfield(edit, '@scale', width, 10em)
"Scalefit: " oxy_checkbox(edit, '@scalefit', values, 'yes') "\A "
}

*[class~="topic/image"][scale]:not([scalefit]):before {
content: "Scale: " oxy_textfield(edit, '@scale', width, 10em)
}


*[class~="topic/image"][scalefit]:not([scale]):before {
content: "Scalefit: " oxy_checkbox(edit, '@scalefit', values, 'yes')
}
Best regards,
Alex
Raga Mounika
Posts: 49
Joined: Mon Mar 28, 2016 3:54 pm

Re: To have both text field,check box for an element

Post by Raga Mounika »

Hi Alex,

Thank you for your reply!

The solution provided is working proper :)

Is it possible to hide all the check boxes and drop-downs in No-tag mode in oXygen?

Regards,
Mounika
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: To have both text field,check box for an element

Post by alex_jitianu »

Hi Mounika,

Unfortunately not. Changing the tags display mode only affects the little markers we paint to mark the beginning and end of an element. What you could do is to create an alternate CSS and put the special rules there. When the users select this CSS from the Styles item on the toolbar, the CSS rules from it will activate and could hide the check boxes etc.

Best regards,
Alex
Post Reply