Expand my Community achievements bar.

Overlaying

Avatar

Level 3

While overlying a custom component how to hide the particular node(children)

6 Replies

Avatar

Community Advisor

Use below property

  • sling:hideChildren (String or String[])
    Contains the child node, or list of child nodes, to hide. The properties of the node will be maintained.
    The wildcard * hides all.

Please check

Using the Sling Resource Merger in AEM



Arun Patidar

Avatar

Level 3

yeah thank you,

What if we want to hide the particular field.

Avatar

Community Advisor

Hi,

what do you mean by field? could you please explain more with screenshot.

You have following options to hide field(resource / child nodes) and properties.

The resource merger provides the following properties:

  • sling:hideProperties (String or String[])
    Specifies the property, or list of properties, to hide.
    The wildcard * hides all.
  • sling:hideResource (Boolean)
    Indicates whether the resources should be completely hidden, including its children.
  • sling:hideChildren (String or String[])
    Contains the child node, or list of child nodes, to hide. The properties of the node will be maintained.
    The wildcard * hides all.


Arun Patidar

Avatar

Level 3

Hello Arun,

While inheriting a custom component, if we dont want the particlular field(Example: Some Image Field is not neccessary but all other fields we need). Then how to hide that particular image field.

Avatar

Community Advisor

Are you using sling:resourceSuperType or overlay(copy nodes from libs to apps)?

If you are using overlay then just just add property sling:hideChildren = childnodepath

There is another way to show or hide field using granite:renderCondition

Render Condition — Granite UI 1.0 documentation



Arun Patidar

Avatar

Level 4

As mentioned by Arun Patidar​ , just adding property sling:hideResource="{Boolean}true" in that overlayed field will help you to hide it. It works fine for me !!!