Apply sorted tree nodes to siteadmin 'redirect' pathfield | Community
Skip to main content
Level 3
October 16, 2015
Solved

Apply sorted tree nodes to siteadmin 'redirect' pathfield

  • October 16, 2015
  • 14 replies
  • 3249 views

Our customer wants to be able to see tree nodes in alphanumeric order in the pathfield dialog from the 'redirect' field on the siteadmin page properties dialog. I found an article here - http://experience-aem.blogspot.com/2014/04/aem-cq-56-sort-tree-nodes-of-browse-dialog-pathfield.html - that shows what appears to be a pretty simple solution to what our customer wants. I've been struggling with this for a couple of days but can't seem to find the right solution to add the listener described in the article to the built-in siteadmin page. I tried copying /libs/foundation/component/page component to /apps/foundation/component/page and applying the listener and additional javascript there but that didn't work.

What is the best way to accomplish what I need?

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 edubey

While creating template is AEM we usually inherit the functionality from OOTB page component on top of which we add our own files.

So in all at the end /libs/foundation/components/page will be rendering. Now here is the point, have you override dialog of OOTB page component.

Can you see dialog at /apps/history/pages/page path ?

Here is great article by Adobe : https://docs.adobe.com/docs/en/cq/5-6-1/howto/website.html

14 replies

Level 3
October 16, 2015

Thanks for the reply. Here's the XML for the dialog:

<?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:Dialog" height="400" stateful="false" xtype="dialog"> <items jcr:primaryType="cq:WidgetCollection"> <tabs jcr:primaryType="cq:TabPanel"> <items jcr:primaryType="cq:WidgetCollection"> <basic jcr:primaryType="cq:Widget" path="/apps/foundation/components/page/tab_basic.infinity.json" xtype="cqinclude"/> <advanced jcr:primaryType="cq:Widget" path="/apps/foundation/components/page/tab_advanced.infinity.json" xtype="cqinclude"/> <image jcr:primaryType="cq:Widget" path="/apps/foundation/components/page/tab_image.infinity.json" xtype="cqinclude"/> <cloudservices jcr:primaryType="cq:Widget" path="/apps/foundation/components/page/tab_cloudservices.infinity.json" xtype="cqinclude"/> <blueprint jcr:primaryType="cq:Widget" path="/apps/foundation/components/page/tab_blueprint.infinity.json" xtype="cqinclude"/> <livecopy jcr:primaryType="cq:Widget" path="/apps/foundation/components/page/tab_livecopy.infinity.json" xtype="cqinclude"/> </items> </tabs> </items> </jcr:root>

But since the advanced tab from the dialog is an include, here's part of the XML from /apps/foundation/components/page/tab_advanced (note the 'listener' on the 'redirect' item):

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="cq:Panel" title="Advanced"> <items jcr:primaryType="cq:WidgetCollection"> <advanced jcr:primaryType="cq:Widget" collapsed="{Boolean}false" collapsible="{Boolean}false" xtype="dialogfieldset"> <items jcr:primaryType="cq:WidgetCollection"> <language jcr:primaryType="cq:Widget" cls="cq-propsdialog-pagelanguage" fieldLabel="Language" name="./jcr:language" optionsProvider="CQ.utils.WCM.getLanguageOptions" type="select" xtype="selection"/> <redirect jcr:primaryType="cq:Widget" fieldLabel="Redirect" name="./redirectTarget" xtype="pathfield"> <listeners jcr:primaryType="nt:unstructured" dialogopen="function(){ExperienceAEM.sortTags(this, true);} "/> </redirect> <designpath jcr:primaryType="cq:Widget" fieldLabel="Design" name="./cq:designPath" predicate="hierarchyNotFile" rootPath="/etc/designs" xtype="pathfield"/> <alias jcr:primaryType="cq:Widget" fieldLabel="Alias" name="./sling:alias" xtype="textfield"/> </items> </advanced>

Any guidance on what I'm doing wrong would be greatly appreciated!

edubey
Level 10
October 16, 2015

Hi Randy,

I think you might have already added page component in your project, Can you try to add listeners there?

Would you mind sharing a XML for your dialog, it would help community to answer better.

Thanks

Level 3
October 16, 2015

Yes - the clientlibs folder has a categories property with a value of cq:widgets and it's got a jcr:primaryType value of cq:clientLibraryFolder.

edubey
Level 10
October 16, 2015
Okay..... Have you added categories = cq.widgets in clientlib properties?