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}
Solved! Go to Solution.
Views
Replies
Total Likes
i got one more solution Using
cq:include also we can achieve.
using namespace
this way we will not have create nodes again
@sherinregi
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.
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.
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"/>
Thanks @sherinregi let me try.
i got one more solution Using
cq:include also we can achieve.
using namespace
this way we will not have create nodes again
@sherinregi
Views
Likes
Replies