Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM 6.2 classic : Add custom button in sidekick to open selector page

Avatar

Level 8

Hi All,

We have a requirement, wherein we need to add a custom button in sidekick,which should open the current page with 'selector'.

Basically, if I have a page http://localhost:4502/cf#/content/sample/en/300.html , then on clicking that custom button, the current page should open with url http://localhost:4502/cf#/content/sample/en/300.selector.html [may be in a new tab].

Regarding where should that button be placed. Is it easy to create a new tab like thing[like on OOTB sidekicks we have for Page, Information, Versioning etc] and place it there or to add it to any existing ones. Easiest option would do.

Any thoughts/pointers/reference articles on this will be very helpful.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Here is an older community article - that Praveen contributed - that talks about how to customize the side kick that may help point you in the correct direction -- Adobe Experience Manager Help | Customizing the Adobe Experience Manager Sidekick to improve the act...

View solution in original post

5 Replies

Avatar

Level 10

Are you referring to touch ui or classic ui?

Avatar

Correct answer by
Level 10

Here is an older community article - that Praveen contributed - that talks about how to customize the side kick that may help point you in the correct direction -- Adobe Experience Manager Help | Customizing the Adobe Experience Manager Sidekick to improve the act...

Avatar

Level 8

Hi Scott/All,

Looks like am able to get an extra button in my sidekick.

If I have a page  http://localhost:4502/cf#/content/sample/en/300.html, on clicking this button, it should add ".selector" to the url and open the url http://localhost:4502/cf#/content/sample/en/300.selector.html in a new tab.

I need to remove the existing logic and tweak it as per above.

Trying to figure that out.

In case any pointers here, will be helpful.

Avatar

Level 8

Hi,

By removing extra code and having below works.

var a,p,pp,url;

a = window.location.hostname;

p = window.location.port;

                       pp = CQ.WCM.getPagePath();

if (pp.indexOf(".selector.html") != -1) {

url = "http://" + a + ":" + p + pp + ".selector.html";

CQ.shared.Util.open(url);

} else {

CQ.Ext.Msg.alert('Selector exists', 'Selector exists on page.');

}

But the condition that if selector.html is present on the url, then show Selector exists else the other condition is not working properly.

Instead of "indexOf" if there is any other method, to be made use of, please let us know.