AEM 6.2 classic : Add custom button in sidekick to open selector page | Community
Skip to main content
cquser1
Level 7
September 7, 2018
Solved

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

  • September 7, 2018
  • 5 replies
  • 2405 views

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.

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 smacdonald2008

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 activate process

5 replies

edubey
Level 10
September 7, 2018

Are you referring to touch ui or classic ui?

cquser1
cquser1Author
Level 7
September 7, 2018

Hi,

Classic UI

smacdonald2008
smacdonald2008Accepted solution
Level 10
September 7, 2018

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 activate process

cquser1
cquser1Author
Level 7
September 7, 2018

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.

cquser1
cquser1Author
Level 7
September 7, 2018

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.