Remove the default colors from Colorfield dialog in AEM

Add the property showDefaultColors="{Boolean}false" 

Once you will add this property. All the default colors will be disappear from the colorfield dialog. You can show your custom colors as per the requirement. Please see the below for the reference. 

<backgroundColor jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/colorfield"

    showDefaultColors="{Boolean}false"

    text="Background Color"

    fieldLabel="Background Color"

    name="./backgroundColor"

    showProperties="{Boolean}false">

  <items jcr:primaryType="nt:unstructured">

<red jcr:primaryType="nt:unstructured" value="#FF0000"/>

    <white jcr:primaryType="nt:unstructured" value="#FFFFFF"/>

    <black jcr:primaryType="nt:unstructured" value="#000000"/>

  </items>

</backgroundColor>


You can also add showProperties="{Boolean}false" as per the above . if you want to hide the left side part from the color picker dialog then add this property.Please see the snapshot for the reference.


If you want o make the default color value selection in colorfield dialog then add the property as per below. For example if i want to make the red color default field then add the property value="{String}#FF0000"




Comments

Post a Comment

Popular posts from this blog

Create AEM System user | Service user from Configuration | Ensure Service User Config