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

<oXygen/> general issues.
SSC
Posts: 206
Location: Hamburg, Germany

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

Mon Apr 07, 2014 12:05 pm

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: 5689

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

Mon Apr 07, 2014 12:15 pm

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

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 1 guest