Skip to content

Instantly share code, notes, and snippets.

@kevinweber
Last active October 31, 2025 01:54
Show Gist options
  • Save kevinweber/05c4c8cf005a6e640f7c8ad65ef5113c to your computer and use it in GitHub Desktop.
Save kevinweber/05c4c8cf005a6e640f7c8ad65ef5113c to your computer and use it in GitHub Desktop.

Revisions

  1. kevinweber revised this gist Feb 2, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions multifield__AEM6.3.xml
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,10 @@ Usage:
    </sly>
    -->

    <!--
    How to define min/max item limit: http://experience-aem.blogspot.com/2018/01/aem-6310-touch-ui-add-min-max-limit-to-coral-3-multifield.html
    -->

    <nav
    sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
    fieldDescription="Click '+' to add a new link"
  2. kevinweber revised this gist Jan 24, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion checkbox--coral
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,5 @@
    text="Hide Mismatches"
    fieldDescription="Check this box to hide dropdown options if they don't match with the user's input"
    name="./hideMismatches"
    value="{Boolean}true"/>
    value="{Boolean}true"
    uncheckedValue="{Boolean}false"/>
  3. kevinweber revised this gist Jan 8, 2018. 1 changed file with 20 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions fileupload.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    <fileupload
    jcr:primaryType="nt:unstructured"
    jcr:title="Files"
    sling:resourceType="granite/ui/components/foundation/form/fieldset">
    <items jcr:primaryType="nt:unstructured">
    <file
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/fileupload"
    autoStart="{Boolean}true"
    cq-msm-lockable="/file"
    fieldLabel="Upload files"
    mimeTypes="[image/png,image/jpeg,application/pdf]"
    multiple="{Boolean}false"
    name="./file"
    sizeLimit="100000000"
    text="Upload file"
    uploadUrl="/content/dam/someurl"
    uploadUrlBuilder=""/>
    </items>
    </fileupload>
  4. kevinweber revised this gist Nov 28, 2017. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions pathbrowser--coral.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <buttonPath
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
    rootPath="/content/"
    emptyText="Path to target page"
    fieldLabel="Button Link"
    name="./buttonPath"/>
  5. kevinweber revised this gist Nov 27, 2017. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions colorfield.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <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">
    <white jcr:primaryType="nt:unstructured" value="#FFFFFF"/>
    <black jcr:primaryType="nt:unstructured" value="#000000"/>
    <hugo-blue jcr:primaryType="nt:unstructured" value="#D8F1FF"/>
    <hugo-brown jcr:primaryType="nt:unstructured" value="#451A0C"/>
    <hugo-cream jcr:primaryType="nt:unstructured" value="#F6F6EC"/>
    <hugo-green jcr:primaryType="nt:unstructured" value="#AECDC7"/>
    <hugo-gray jcr:primaryType="nt:unstructured" value="#3C3C3C"/>
    </items>
    </backgroundColor>
  6. kevinweber revised this gist Nov 27, 2017. 1 changed file with 30 additions and 0 deletions.
    30 changes: 30 additions & 0 deletions buttongroup.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    <alignment jcr:primaryType="nt:unstructured"
    name="./alignChildren"
    fieldLabel="Alignment of components"
    required="{Boolean}true"
    selectionMode="single"
    sling:resourceType="granite/ui/components/coral/foundation/form/buttongroup">

    <items jcr:primaryType="nt:unstructured">
    <default jcr:primaryType="nt:unstructured"
    name="./default"
    text="Default"
    value="false"
    cq-msm-lockable="default"/>
    <left jcr:primaryType="nt:unstructured"
    name="./left"
    text="Left"
    value="left"
    cq-msm-lockable="left"/>
    <center jcr:primaryType="nt:unstructured"
    name="./center"
    text="Center"
    value="center"
    cq-msm-lockable="center"/>
    <right jcr:primaryType="nt:unstructured"
    name="./right"
    text="Right"
    value="right"
    cq-msm-lockable="right"/>
    </items>
    </alignment>
  7. kevinweber revised this gist Oct 5, 2017. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions select--coral.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    <linkColor
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/select"
    fieldLabel="Link Color"
    name="./linkColor">
    <items jcr:primaryType="nt:unstructured">
    <primary jcr:primaryType="nt:unstructured"
    text="Primary"
    value="primary"/>
    <secondary jcr:primaryType="nt:unstructured"
    text="Secondary"
    value="secondary"/>
    </items>
    </linkColor>
  8. kevinweber revised this gist Sep 27, 2017. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions numberfield--coral
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <columnWidth
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
    fieldLabel="Field width in grid"
    defaultValue="4"
    min="1"
    max="12"
    step="1"
    name="./columnWidth"/>
  9. kevinweber revised this gist Sep 26, 2017. 2 changed files with 7 additions and 13 deletions.
    7 changes: 7 additions & 0 deletions checkbox--coral
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <hideMismatches
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
    text="Hide Mismatches"
    fieldDescription="Check this box to hide dropdown options if they don't match with the user's input"
    name="./hideMismatches"
    value="{Boolean}true"/>
    13 changes: 0 additions & 13 deletions checkbox-as-boolean
    Original file line number Diff line number Diff line change
    @@ -1,13 +0,0 @@
    // See: http://stackoverflow.com/a/36076816
    <myCheckbox
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/checkbox"
    text="My Checkbox"
    name="./myCheckbox"
    value="true"
    checked="true"/>
    <myCheckboxType
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/hidden"
    name="./myCheckbox@TypeHint"
    value="Boolean"/>
  10. kevinweber revised this gist Sep 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion text
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@

    OR

    <intro
    <info
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/text"
    text="Please note that this component is not to be used to include JavaScript or CSS."/>
  11. kevinweber revised this gist Sep 25, 2017. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions multifield__AEM6.3.xml
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,13 @@
    <!--
    Usage:
    <sly data-sly-list="${resource.children}">
    <sly data-sly-list="${item.children}">
    ${item.linkText}
    ${item.linkUrl}
    </sly>
    </sly>
    -->

    <nav
    sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
    fieldDescription="Click '+' to add a new link"
  12. kevinweber revised this gist Sep 25, 2017. 2 changed files with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions multifield__AEM6.3.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <nav
    sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
    fieldDescription="Click '+' to add a new link"
    fieldLabel="Links"
    jcr:primaryType="nt:unstructured"
    composite="{Boolean}true">
    <field sling:resourceType="granite/ui/components/coral/foundation/container"
    jcr:primaryType="nt:unstructured" name="./items">
    <items jcr:primaryType="nt:unstructured">
    <linkText
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldLabel="Link Text"
    jcr:primaryType="nt:unstructured"
    name="./linkText" />
    <linkurl
    sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
    fieldLabel="Link Url"
    jcr:primaryType="nt:unstructured"
    name="./linkUrl" />
    </items>
    </field>
    </nav>
  13. kevinweber revised this gist Sep 19, 2017. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions textarea--coral
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <html
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/textarea"
    fieldLabel="HTML"
    name="./html"
    required="true"/>
  14. kevinweber revised this gist Aug 29, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion multifield
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,5 @@
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/textfield"
    required="true"
    name="./headlines"/>
    name="./headlines"/>
    </headlines>
  15. kevinweber revised this gist Jul 5, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions richttext
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ http://stackoverflow.com/questions/34309445/aem-6-1-enable-rich-text-editor-rte-
    sling:resourceType="cq/gui/components/authoring/dialog/richtext"
    fieldDescription="Sets the description that appears on the profiled person's page."
    fieldLabel="Long Description*"
    required="true"
    useFixedInlineToolbar="{Boolean}true"
    name="./longDescriptionText">
    <rtePlugins jcr:primaryType="nt:unstructured">
  16. kevinweber revised this gist Jul 5, 2017. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions text
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,12 @@
    <intro
    jcr:primaryType="nt:unstructured"
    sling:resourceType="wcm/foundation/components/text"
    text="Please note that this component is not to be used to include JavaScript or CSS."/>


    OR

    <intro
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/text"
    text="Please note that this component is not to be used to include JavaScript or CSS."/>
  17. kevinweber revised this gist Jul 5, 2017. 1 changed file with 23 additions and 1 deletion.
    24 changes: 23 additions & 1 deletion richttext
    Original file line number Diff line number Diff line change
    @@ -1 +1,23 @@
    http://stackoverflow.com/questions/34309445/aem-6-1-enable-rich-text-editor-rte-plugins-on-touch-ui
    http://stackoverflow.com/questions/34309445/aem-6-1-enable-rich-text-editor-rte-plugins-on-touch-ui

    -------

    <longDescriptionText
    jcr:primaryType="nt:unstructured"
    sling:resourceType="cq/gui/components/authoring/dialog/richtext"
    fieldDescription="Sets the description that appears on the profiled person's page."
    fieldLabel="Long Description*"
    useFixedInlineToolbar="{Boolean}true"
    name="./longDescriptionText">
    <rtePlugins jcr:primaryType="nt:unstructured">
    <format
    jcr:primaryType="nt:unstructured"
    features="[bold,italic]"/>
    <justify
    jcr:primaryType="nt:unstructured"
    features="[]"/>
    <lists
    jcr:primaryType="nt:unstructured"
    features="[]"/>
    </rtePlugins>
    </longDescriptionText>
  18. kevinweber revised this gist Jun 12, 2017. 1 changed file with 36 additions and 0 deletions.
    36 changes: 36 additions & 0 deletions multifield__nested--acs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    <footernavitems jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/multifield"
    class="full-width"
    fieldDescription="Click '+' to add a new link"
    fieldLabel="Links">
    <field jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/fieldset"
    acs-commons-nested="NODE_STORE"
    name="./footernavitems">
    <layout jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
    method="absolute"/>
    <items jcr:primaryType="nt:unstructured">
    <column jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/container">
    <items jcr:primaryType="nt:unstructured">
    <text jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/textfield"
    fieldLabel="Text"
    name="./text"/>
    <link jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/pathbrowser"
    fieldLabel="Link"
    name="./link"
    rootPath="/content/tesla-configurator"/>
    <hideOnMobile
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/checkbox"
    text="Hide on mobile?"
    value="true"
    name="./hideOnMobile"/>
    </items>
    </column>
    </items>
    </field>
    </footernavitems>
  19. kevinweber revised this gist Jun 5, 2017. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions multifield
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <headlines
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/multifield"
    fieldDescription="Click 'Add field' to add new content dropdown."
    fieldLabel="Headlines">
    <field
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/textfield"
    required="true"
    name="./headlines"/>
  20. kevinweber revised this gist May 2, 2017. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions checkbox-as-boolean
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    // See: http://stackoverflow.com/a/36076816
    <myCheckbox
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/checkbox"
    text="My Checkbox"
    name="./myCheckbox"
    value="true"
    checked="true"/>
    <myCheckboxType
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/hidden"
    name="./myCheckbox@TypeHint"
    value="Boolean"/>
  21. kevinweber revised this gist Apr 27, 2017. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions textfield--coral
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <carModel
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldLabel="Model"
    value="carModel"
    name="./carModel"/>
  22. kevinweber revised this gist Apr 25, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions text--coral
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    <inputgroup
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/text"
    text="Enable user sharing for"/>
  23. kevinweber revised this gist Mar 30, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions richttext
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    http://stackoverflow.com/questions/34309445/aem-6-1-enable-rich-text-editor-rte-plugins-on-touch-ui
  24. kevinweber revised this gist Mar 2, 2017. 4 changed files with 24 additions and 17 deletions.
    10 changes: 5 additions & 5 deletions checkbox
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    <columnLast
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/checkbox"
    text="Last column in grid?"
    value="true"
    name="./columnLast"/>
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/checkbox"
    text="Last column in grid?"
    value="true"
    name="./columnLast"/>
    16 changes: 8 additions & 8 deletions numberfield
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    <columnWidth
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/numberfield"
    fieldLabel="Field width in grid"
    defaultValue="4"
    min="1"
    max="12"
    step="1"
    name="./columnWidth"/>
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/numberfield"
    fieldLabel="Field width in grid"
    defaultValue="4"
    min="1"
    max="12"
    step="1"
    name="./columnWidth"/>
    7 changes: 7 additions & 0 deletions pathbrowser
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <buttonPath
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/pathbrowser"
    rootPath="/content/"
    emptyText="Path to target page"
    fieldLabel="Button Link"
    name="./buttonPath"/>
    8 changes: 4 additions & 4 deletions textfield
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    <inputExtraCssClass
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/textfield"
    fieldLabel="Input CSS class"
    name="./inputExtraCssClass"/>
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/textfield"
    fieldLabel="Input CSS class"
    name="./inputExtraCssClass"/>
  25. kevinweber revised this gist Feb 23, 2017. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions select
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    <linkColor
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/select"
    fieldLabel="Link Color"
    name="./linkColor">
    <items jcr:primaryType="nt:unstructured">
    <primary jcr:primaryType="nt:unstructured"
    text="Primary"
    value="primary"/>
    <secondary jcr:primaryType="nt:unstructured"
    text="Secondary"
    value="secondary"/>
    </items>
    </linkColor>
  26. kevinweber revised this gist Feb 18, 2017. 3 changed files with 20 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions checkbox
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <columnLast
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/checkbox"
    text="Last column in grid?"
    value="true"
    name="./columnLast"/>
    9 changes: 9 additions & 0 deletions numberfield
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <columnWidth
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/numberfield"
    fieldLabel="Field width in grid"
    defaultValue="4"
    min="1"
    max="12"
    step="1"
    name="./columnWidth"/>
    5 changes: 5 additions & 0 deletions textfield
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    <inputExtraCssClass
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/textfield"
    fieldLabel="Input CSS class"
    name="./inputExtraCssClass"/>
  27. kevinweber created this gist Feb 17, 2017.
    4 changes: 4 additions & 0 deletions text
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    <intro
    jcr:primaryType="nt:unstructured"
    sling:resourceType="wcm/foundation/components/text"
    text="Please note that this component is not to be used to include JavaScript or CSS."/>
    6 changes: 6 additions & 0 deletions textarea
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <html
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/textarea"
    fieldLabel="HTML"
    name="./html"
    required="true"/>