bunny
bunny

Reputation: 1

My question is about Ability for an author to reorder each tab within the component dialog in aem

enter image description here

I want to know how to provide the numbering for each tab, so that author can provide the number as per their requirement.

Upvotes: 0

Views: 477

Answers (2)

d33t
d33t

Reputation: 1161

This is the strangest requirement I ever heard of. You can sure do that, but it didn't make much sense of doing it system wide as one author can feel the dialog one way, other in completely different. The only reasonable solution is to use javascript to reorder the tabs in the way an author want and than save the settings for this specific component in his user profile. You can start implementing it by creating a clientlib with the category cq.authoring.dialog. In your JS you have to listen to specific dialog loading event as shown below. I think this should be enough and it's a good starting point.

         // necessary as no granite or coral ui event is triggered, when the dialog is opened
        // in a fullscreen mode the dialog is opened under specific url for serving devices with low screen resolution       
        if (location.href.match(/mnt\/override/)) {
            $(window).on('load', function(e) {
                setTimeout(doSomething, 100);
            });
        } else {
            $(document).on('dialog-ready', function(e) {
                Coral.commons.ready(function(){
                    setTimeout(doSomething, 100);
                });
            });
        }

You can use granite:rel to define specific identifiers in the dialog definition and use save them later in the user settings. You can define drag & drop events using the tab selector [role="tab"].

Upvotes: 2

Florian Salihovic
Florian Salihovic

Reputation: 3951

This is not trivially possible. Decide upfront about the order when building the component, provide meaningful labels and go with that. Touch UI does not provide the feature you need.

Upvotes: 0

Related Questions