Diazo Rule drop Element if empty and not in Edit-Mode

Hi, i need a Rule to drop the complete #content-core Section if the Node has no Child's, but not if "edit"-Mode is the current View. Yet, i use the following rule, but how can i check the condition "not child nodes or empty":
<rules css:if-content="body.portaltype-document"> <rules css:if-not-content="body.template-edit"> <drop css:content="#content-core" /> </rules> </rules>
best regards, jan

I think this should work:
<drop content="//*[@id='content-core][not(node())][not(text()]" />

More over you can concatenate your two if rule in a single one:

    <drop content="//*[@id='content-core][not(node())][not(text()]" />

or even:
`<drop css:if-content="body.portaltype-document:not(.template-edit)" content="//*[@id='content-core][not(node())][not(text()]" />`
1 Like

Thanks for help, i found another solution, based on diazo docs: <drop css:if-content="body.portaltype-document:not(.template-edit)" content="//*[@id='content-core'][not(*) and (not(normalize-space()))]"/>

1 Like