Skip to main content
Level 3
September 9, 2022
Beantwortet

style system - dynamically adding the styles tab on the dialog

  • September 9, 2022
  • 1 Antwort
  • 653 Ansichten

Hello,

could someone help me the below please?

Have updated styles for the teaser component under policy & dialog also getting updated with the style tab along with the styles added in the policies. May I know is it possible to change the order of the style tab? Currently its coming before the link & actions tab. But I want to add it at starting as a first tab. Kindly suggest.

 

Thank you

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von lukasz-m

Hi @lakshmi9,

This is possible. You can use Sling Resource Merger functionality:

In your proxy component you should add cq:dialog structure like this:

<cq:dialog jcr:primaryType="nt:unstructured">
    <content jcr:primaryType="nt:unstructured">
        <items jcr:primaryType="nt:unstructured">
            <tabs jcr:primaryType="nt:unstructured">
                <items jcr:primaryType="nt:unstructured">
                    <cq:styles jcr:primaryType="nt:unstructured" 
                        path="/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_edit/styletab"
                        sling:orderBefore="image" 
                        sling:resourceType="granite/ui/components/coral/foundation/include"/>
                </items>
            </tabs>
        </items>
    </content>
</cq:dialog>

and the result:

1 Antwort

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAntwort
Community Advisor
September 9, 2022

Hi @lakshmi9,

This is possible. You can use Sling Resource Merger functionality:

In your proxy component you should add cq:dialog structure like this:

<cq:dialog jcr:primaryType="nt:unstructured">
    <content jcr:primaryType="nt:unstructured">
        <items jcr:primaryType="nt:unstructured">
            <tabs jcr:primaryType="nt:unstructured">
                <items jcr:primaryType="nt:unstructured">
                    <cq:styles jcr:primaryType="nt:unstructured" 
                        path="/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_edit/styletab"
                        sling:orderBefore="image" 
                        sling:resourceType="granite/ui/components/coral/foundation/include"/>
                </items>
            </tabs>
        </items>
    </content>
</cq:dialog>

and the result: