cq5 - show current page path in paragraph reference in AEM -


i having dialog xtype field "paragraphreference". when open field showing whole content repository. want show current page path in paragraph reference field. dont want overlay js file. there other solution or property can give current page path show.

please suggest.

you can custom widget plugin. first, add property plugins pathfield in dialog.xml:

<mypathcomponent     jcr:primarytype="cq:widget"     fieldlabel="my path component"     plugins="customrootpathplugin"     xtype="pathfield" /> 

then create custom extjs plugin. in order that, create new js file, , add clientlib cq.wcm.edit category. plugin can 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); 

}($cq));

also can take ref : click


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -