Where do you manage to hide the content of an element with c

Oxygen general issues.
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Where do you manage to hide the content of an element with c

Post by SSC »

Hello,

we are using the Oxygen Author Eclipse plugin in version 15.2.

I wanted to copy the dita conref functionality for the Pi-Mod framework.
With the help of your sdk samples I succeeded in showing the conref content inide the editor.
But the actual content and childelements of the XML element, which has the conref attribute is also shown.

I thought it would be hidden by overriding the de.kgucms.kgu.tps.client.oxygen.extensions.pimod.extensionsbundle.PiModExtensionsBundle.isContentReference(AuthorNode) method:

Code: Select all


    @Override
public boolean isContentReference(AuthorNode authornode) {
if (authornode.getType() == AuthorNode.NODE_TYPE_ELEMENT) {
AuthorElement elem = (AuthorElement) authornode;
if (elem.getAttribute("conref") != null
|| elem.getAttribute("conkeyref") != null) {
return true;
}
}
return false;
}
But I guess something else has to be done, in order to hide the conref element.

Could you please tell me how to achieve that?

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Where do you manage to hide the content of an element wi

Post by Radu »

Hi Simon,

Hiding the actual content is done from this CSS:

OXYGEN_INSTALL_DIR\frameworks\dita\css_classed\conrefs.css

For example for a DITA table which has a conref the CSS has selectors like:

Code: Select all

*[class~="topic/topic"][conkeyref] > *[class~="topic/topic"],
*[class~="topic/topic"][conref] > *[class~="topic/topic"]
{
display : inherit;
}

*[class~="topic/table"][conkeyref] > *,
*[class~="topic/table"][conref] > *
{
display : none;
}
which hide all the content from it except the conreffed table child.
Unfortunately I cannot give you a generic way to specify this from the CSS for any XML element, you need to add special cases like we did in our "conrefs.css". Usually there are not very many actually reused elements which also have required content.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply