style system - dynamically adding the styles tab on the dialog | Community
Skip to main content
Level 3
September 9, 2022
Solved

style system - dynamically adding the styles tab on the dialog

  • September 9, 2022
  • 1 reply
  • 639 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by 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 reply

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
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: