Hi ,
I am able to add the new buttons to the action bar in sites.html by customizing the selection actions but not able to do any activities. I am adding here my sample code and approach please guide me what needs to do fix this.
Here is my code in apps
<jcr:content
jcr:mixinTypes="[sling:VanityPath]"
jcr:primaryType="nt:unstructured"
jcr:title="AEM Sites"
sling:resourceType="granite/ui/components/shell/collectionpage"
sling:vanityOrder="{Long}301"
sling:vanityPath="/sites"
consoleId="cq-sites"
modeGroup="cq-siteadmin-admin-childpages"
omnisearchLocationPath="/libs/granite/omnisearch/content/metadata/site"
pageURITemplate="/sites.html{+id}"
targetCollection=".cq-siteadmin-admin-childpages">
<actions jcr:primaryType="nt:unstructured">
<selection jcr:primaryType="nt:unstructured">
<test
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/endor/actionbar/button"
class="foundation-collection-action cq-siteadmin-admin-actions-eahelp-preview cq-siteadmin-admin-actions-publish-activator"
foundation-collection-action="\{"target": ".cq-siteadmin-admin-childpages", "activeSelectionCount": "single"}"
foundation-mode-group="cq-siteadmin-admin-searchpages"
foundation-mode-value="default"
text="Test"
variant="actionBar"/>
</selection>
</actions>
</jcr:content>
</jcr:root>
client libs for this
Client lib properties :
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:ClientLibraryFolder"
categories="[granite.ui.foundation.admin]"/>
and JS file I am trying to capture the click event.
(function(window, document, Granite, $) {
"use strict";
alert("hi");
var TWITTER_ACTIVATOR = ".cq-siteadmin-admin-actions-eahelp-preview";
$(document).on("click", TWITTER_ACTIVATOR, function(e) {
var selection = $(".foundation-collection").first().find(".foundation-selections-item").first();
var path = selection.data("foundationCollectionItemId") || selection.data("path");
alert (path);
etc .........
I am not seeing any action for this button.
Here I have couple of doubts
1. Am I using the correct category ?If not what is the correct one to use it.
2. Where can I get the list categories used in AEM? I tried to get the list but not able to get it.
Here is the my screen output
Please advice what needs to correct here and what needs to add extra to see the actions on this button. Very Urgent.
Thanks In Advance.
Views
Replies
Total Likes
Can you share the package with node and JS ?
To answer your question: Where can I get the list categories used in AEM? I tried to get the list but not able to get it.
check here http://localhost:4502/libs/granite/ui/content/dumplibs.html
Thanks
You can upload zip file in google drive and share the link
Thanks
Whats the use case of the action you are trying to achieve?
Thanks
when the user wants to see a preview of the page we wanted to redirect to the external site by passing the selected page.
The preview we are displaying in the new tab. I am able to write that for in the edit mode of the page but user prefers that option here.
Thanks
@edubey, Any luck here? Is there anything wrong in js or in category choosing for the client libs?
I have tried couple more categories as well but no luck from my side.
if you able to provide me some insight that would be great to proceed.
Thanks In advance.
Hi @edubey, I am able to resolve it. I am using this category now "cq.common.wcm" and modified the littile bit of dialog fields as well.
Thanks for checking on this.