Expand my Community achievements bar.

SOLVED

Customization on Content Fragment Model Add multifield contain 3 text field in CFM [AEM6.5]

Avatar

Level 7

Hi Team,
I need reference where I want to add a custom multifield which contain [3 text field] in content fragment Model.
I came across some good documentation

But I am not able to add multifield which contain [3 text fields] in Content Fragment Model:

Like I want to include multifield

 

{
    "jcr:primaryType": "nt:unstructured",
    "colors": {
        "jcr:primaryType": "nt:unstructured",
        "composite": true,
        "fieldLabel": "Colors",
        "sling:resourceType": "granite/ui/components/coral/foundation/form/multifield",
        "fieldDescription": "Click 'Add field' to add a new color",
        "granite:data": {
            "jcr:primaryType": "nt:unstructured",
            "item-limit": "2"
        },
        "field": {
            "jcr:primaryType": "nt:unstructured",
            "name": "./colors",
            "sling:resourceType": "granite/ui/components/coral/foundation/container",
            "items": {
                "jcr:primaryType": "nt:unstructured",
                "color": {
                    "jcr:primaryType": "nt:unstructured",
                    "name": "color",
                    "fieldLabel": "Color",
                    "sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
                    "fieldDescription": "Fill in a hex value: # and 6 characters"
                },
                "color2": {
                    "jcr:primaryType": "nt:unstructured",
                    "name": "color2",
                    "fieldLabel": "Color2",
                    "sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
                    "fieldDescription": "Fill in a hex value: # and 6 characters"
                },
                "color3": {
                    "jcr:primaryType": "nt:unstructured",
                    "name": "color3",
                    "fieldLabel": "Color3",
                    "sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
                    "fieldDescription": "Fill in a hex value: # and 6 characters"
                }
            }
        }
    }
}

 


Example I want to see this custom dialog over:

tushaar_srivastava_0-1715545704679.png

 

In order to add this custom field maybe we need to overlay /libs/settings/dam/cfm/models/formbuilderconfig/datatypes/items, but problem is how can I add a multifiled which contains 2 text field in it.


Please let me know the way to achieve this.

Thanks

@kautuk_sahni  @lukasz-m  @EstebanBustamante 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
4 Replies

Avatar

Community Advisor

Hi @tushaar_srivastava ,

If I understand the ask correctly you need a multifield to add the color required in the CFM right? 
If so you can render the Single Line Text as a Multiple Field and you need not overlay the CFM. You can refer the screenshots I am adding below

MadhurMadan_0-1715586775765.png

While editing the CF created from the above CFM it would appear like this

MadhurMadan_1-1715586830006.png


Thanks,
Madhur

Avatar

Level 7

Hi @Madhur-Madan ,

Actually no. I want to add color which contain two textfield inside one multifield.

 

I am looking to add a multifield in that which contain two text field instead of one.

tushaar_srivastava_0-1715588576909.png

 

Avatar

Correct answer by
Community Advisor