Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Node

Avatar

Level 2

When we use multifield it creates node on /content/{page}/jcr:content/{component}/node.
Basically creates node under component.

Is There a way without using multifield we can create node under /content/{page}/jcr:content/{component}/node.
Out Of The BOX.

Because for eg:- i  have component which use 2 buttons 1> PrimaryButton . 2> SecondaryButton
as both are button they will have same props.

Is there a way without multifield i can create  node like this under the component.
/content/{page}/jcr:content/{component}/
                                                                +{primarybutton}
                                                                +{secondarybutton}

1 Accepted Solution

Avatar

Correct answer by
Level 2

i got one more solution Using
cq:include also we can achieve.
using namespace

user06615_0-1696577756429.png

this way we will not have create nodes again
@sherinregi 

 

View solution in original post

5 Replies

Avatar

Community Advisor

Hey @user06615 

 

In Coral 3 Multifield the node is created for each multifield item added. May I know the exact use case for which you need 2 nodes for primaryButton and secondaryButton to be displayed under the component. 

 

Avatar

Level 2

Hi @ksh_ingole7 if i use multifield.
I will have to use List<Button> to consume data.

But i want to consume under primaryButton, secondaryButton objects.

Avatar

Community Advisor

Hi @user06615 

If you want to create under the component node you can try the below syntax in the component dialog .But one catch is you will have to define the properties for both the buttons as its not shared 

 

<primarybutton
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="button Text"
name="./primarybutton/ctaText"/>

<secondarybutton
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="button Text"
name="./secondarybutton/ctaText"/>

Avatar

Correct answer by
Level 2

i got one more solution Using
cq:include also we can achieve.
using namespace

user06615_0-1696577756429.png

this way we will not have create nodes again
@sherinregi