Sling Resource Merging Properties

In the realm of AEM developers have a powerful tool at their disposal that allows for seamless customization—Sling Resource Merging. This feature might sound a bit technical, but fear not! In this article, we’ll break down the key aspects of Sling Resource Merging and delve into its properties, showing you how they can simplify your development process.


1. A Deeper Look at Sling Resource Merging

Sling Resource Merging is like a code-friendly puzzle solver—it lets you combine resources and properties from different locations without getting tangled up. This is especially handy when you’re looking to make specific changes without messing around in the core functionalities stored in `/libs`. Let’s dive into the properties that make this process smoother.


2. Demystifying Sling Resource Merging Properties

Here’s a rundown of the essential properties you’ll encounter:


2.1. sling:hideProperties (String or String[])

This property allows you to hide certain properties that you don’t want to see. Whether you specify a single property or an array of properties, they’ll vanish from sight. The wildcard `*` works like magic—it hides everything except what you choose; Specifies the property, or list of properties, to hide.The wildcard * hides all.

Example:

1
2
3
4
5
6
7
8
<linkAriaLabel
    jcr:primaryType="nt:unstructured"
    sling:hideProperties="[linkAriaLabel]"
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldDescription="This aria label will be used for the link."
    fieldLabel="Link Aria Label"
    emptyText="Link Aria Label"
    name="./linkAriaLabel"/>

2.2. sling:hideResource (Boolean)

When set to `true`, this property hides a resource entirely, including its children. Think of it as a way to temporarily pull a curtain over a specific resource when you need it out of sight; Indicates whether the resources should be completely hidden, including its children.

Example: In this example, we are hiding linkAriaLabel from being rendered on the view.

1
2
3
4
5
6
7
8
<linkAriaLabel
    jcr:primaryType="nt:unstructured"
    sling:hideResource="{Boolean}true"
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldDescription="This aria label will be used for the link."
    fieldLabel="Link Aria Label"
    emptyText="Link Aria Label"
    name="./linkAriaLabel"/>

2.3. sling:hideChildren (String or String[])

Unlike the previous property, this one selectively hides child nodes while preserving their properties. Whether you’re hiding one or using `*` to hide them all, the properties stay untouched; Contains the child node, or list of child nodes, to hide. The properties of the node will be maintained. The wildcard * hides all.

Example: In this example, all children Granite UI fields are hidden from the view.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<fixedcolums
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
    <items jcr:primaryType="nt:unstructured"
        sling:hideChildren="*">
        <properties
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/container">
            <items jcr:primaryType="nt:unstructured">
                <pageTitle
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/coral/foundation/form/text"
                    ../>
                <description
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/coral/foundation/form/text"
                    ../>
            </items>
        </properties>
    </items>
</fixedcolums>

2.4. sling:orderBefore (String)

This property will force the Granite UI to render before a specific element. In this example, we are forcing the linkAriaLabel to render before the “title” Granite UI; Contains the name of the sibling node that the current node should be positioned in front of.

Example:

1
2
3
4
5
6
7
8
9
10
<title
     ..../>
<linkAriaLabel
    jcr:primaryType="nt:unstructured"
    sling:orderBefore="title"
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldDescription="This aria label will be used for the link."
    fieldLabel="Link Aria Label"
    emptyText="Link Aria Label"
    name="./linkAriaLabel"/>

3. Real-world Applications of These Properties

Let’s translate these properties into practical scenarios:

  1. Tailored Component Styling: Say you have a core component in `/libs` with default styles. Use `sling:hideProperties` to conceal unnecessary styles and introduce your own in `/apps`. This way, you retain the core functionality while customizing the look.
  2. Conditional Rendering: For situations where you need to show or hide an entire component, `sling:hideResource` is your ally. It’s like having a switch to control whether a component and its children should be displayed based on specific conditions.
  3. Optimized Content Arrangement: Use `sling:orderBefore` to reposition components within a container. This property is particularly helpful for responsive designs, ensuring content displays flawlessly on various devices.

4. Wrapping Up

Sling Resource Merging isn’t a mysterious incantation—it’s a tool that simplifies your AEM development journey. By getting acquainted with properties like `sling:hideProperties`, `sling:hideResource`, `sling:hideChildren`, and `sling:orderBefore`, you’re equipped to wield customization powers without the fuss. So go ahead, explore, and let Sling Resource Merging elevate your AEM development game!


Hello, I am an enthusiastic Adobe Community Advisor and a seasoned Lead AEM Developer. I am currently serving as an AEM Technical Lead at MNPDigital.ca, bringing over a decade of extensive web engineering experience and more than eight years of practical AEM experience to the table. My goal is to give back to the AEM Full Stack Development community by sharing my wealth of knowledge with others. You can connect with me on LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back To Top
xx1toto
xx1totol
toto slot
slot gacor
slot pulsa
Slot Dana
slot pulsa
slot pulsa
Situs Toto
situs toto
toto slot
scatter hitam
slot toto
situs toto slot
xx1toto
slot toto
slot toto
Scatter Hitam
Situs toto
Slot Demo
toto slot
Scatter Hitam
bandar togel, situs toto slot
bacan4d
toto slot
Situs Toto Slot
situs slot gacor
situs toto slot
Slot Mahjong
xx1toto
situs slot gacor
Situs Toto
xx1toto
xx1toto, Situs Toto Slot
xx1toto
bacansport
bacan4d
xx1toto, situs toto slot, bandar casino
xx1toto, situs toto slot, bandar casino
xx1toto, situs toto, toto slot
xx1toto, Situs Toto Slot
Link Situs Toto Slot
scatter hitam
xx1toto, situs toto, tabel shio
Situs Scatter Hitam Mahjong Wins 3
xx1toto
xx1toto, situs toto slot, bandar togel
situs toto slot
scatter hitam, black scatter, mahjong wins 3
mahjong scatter
situs toto
black scatter, mahjong wins 3
xx1toto
xx1toto
bacan4d
xx1toto, situs toto
bacansport
bacansport
xx1toto
bacansport
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
slot gacor bacan4d
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
Situs Toto, Toto Slot
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
xx1toto
bacansport
xx1toto
bacan4d
xx1toto
xx1toto
bacan4d login situs toto
situs toto slot
linkbacan4d
bacan4d
bacan4d
bacansports
bacan4dslot gacor<
xx1toto
xx1toto
bacan4d
bacan4d
scatter hitam
xx1toto
xx1toto
xx1toto
bacan4d
bacan4d situs toto macau
bacan4d slot gacor x1000
xx1toto scatter hitam
xx1toto
xx1toto
xx1toto
bacan4d slot gacor 2024
bacansport
bacan4d game slot gacor
ts77casino bet 200
bacansport
aplikasi slot
xx1toto scatter hitam
bacan4d login
bacan4d login situs slot gacor
situs toto
xx1toto
xx1toto
bacansport
bacan4d
xx1toto
xx1toto
slottoto
xx1toto
bacan4d login slot gacor
bacan4d slot
ts77casino
ts77casino
ts77casino
ts77casino
Scatter Hitam
Situs Toto
toto slot
Scatter Hitam
Situs Toto
toto slot
bacan4d situs slot toto
scatter hitam
slot mahjong wins 3
mahjong wins 3 black scatter
scatter hitam
ts77casino
ts77casino
tabel shio 2025
bacan4d slot sever thailand
akun slot bet 400
bacan4d slot gacor toto
instagram bacansports
situs toto
bacan4d slot toto
scatter hitam
Situs Toto
scatter hitam
slot bet kecil
bacansports taruhan bola
taruhan bola
facebook bacan4d
Demo Slot
Situs Toto
toto togel
Toto slot gacor
slot gacor bett 200
situs toto
situs toto
bacan4d situs toto 176
bacan4d slot toto 2025
bacansport
bacantogel
situs slot toto
Situs Toto Slot
Bacansports
Bacantoto Situs Toto Slot
xx1toto
xx1toto
xx1toto, situs toto slot
bacan4d
Situs Toto Slot, Situs Togel, toto slot, xx1toto
scatter hitam
Situs Toto Slot, Bandar Togel, Toto macau
Slot Toto
xx1toto, Login Situs Toto
xx1toto, Situs Toto Slot
Situs Toto Slot, Agen Toto Slot 4D, Tabel Shio
xx1toto, situs toto, toto slot, bandar togel
xx1toto, situs black scatter hitam
Situs Toto Slot, Bandar Togel
xx1toto, situs toto
Situs Toto Slot
Situs Toto Slot
Slot Toto
situs toto slot
bacan4d situs idn slot
bacansports
situs toto slot
bacansport
situs toto slot
situs slot terbaru
agen toto, situs toto
situs toto slot
situs toto slot
situs toto slot
bacan4d
bacan4d
bacan4d
situs toto slot
situs toto slot
Slot Mahjong, Scatter Hitam
xx1toto, situs toto slot
situs toto
situs toto
bandar togel, situs toto slot
toto slot
Bacan4d Login Situs Slot Toto
Bacan4d Login Toto Slot
Bacan4d Situs Toto Slot
Link Alternatif Bacan4d Situs Toto Slot
Bacan4d Slot Gacor
Bacan4d Slot Bet 400
Bacantoto Situs Slot
BACANTOTO Situs Toto
toto slot
bacansport
Toto Slot
Bacan4d login
Slot Toto
BACANSPORTS | Slot Gacor Games
Slot Toto
Slot Toto
bacansport
Slot toto
bacansport
bacansport
bacansport
bacansport
bacansport
Bacan4d Link Alternatif
Bacan4d Rtp Slot
bacan4d
ts77casino
taruhan bola
ubobet bola
bacansport
situs taruhan bola indonesia
situs taruhan bola
Login Toto
taruhan bola
judi bola
taruhan bola
bacan4d
toto slot
bacan4d promo
bacantoto casino slot
bacansport
Bacansports Piala Dunia 2026
bacan4d daftar
bacan4d
bacansport
Slot Dana
bacansports
bacansports
Bacan4d Toto
bacansports
slot dana
Slot Bola
bacantogel
bacantogel
slot toto
bacansports