Home Ask Login Register

Developers Planet

Your answer is one click away!

Manan Kapoor February 2016

show current page path in paragraph reference in AEM

I am having dialog with xtype field as "paragraphreference". When i open the field it is showing the whole content repository. I want to show only current page path in the paragraph reference field. I dont want to overlay the js file. Is there any other solution or property which can give the current page path to show.

Please suggest.


Niks February 2016

You can do it with custom widget plugin. First, add property plugins to your pathfield in the dialog.xml:

    fieldLabel="My path component"
    xtype="pathfield" />

Then create custom ExtJS plugin. In order to do that, create new JS file, and add it to clientlib with cq.wcm.edit category. Plugin can look like that:

(function($) {
var plugin = CQ.Ext.extend(CQ.Ext.emptyFn, {
    init: function(widget) {
       var currentPath = CQ.WCM.getPagePath();
        widget.treeRoot.name = currentPath;

CQ.Ext.ComponentMgr.registerPlugin('customRootPathPlugin', plugin);


Also you can take ref from : Click

Post Status

Asked in February 2016
Viewed 1,904 times
Voted 6
Answered 1 times


Leave an answer

Quote of the day: live life