Quantcast
Channel: Experiencing Adobe Experience Manager (AEM, CQ)
Viewing all articles
Browse latest Browse all 525

AEM 62 - Classic UI show Nodename and not dc:title or jcr:title in Path Field of RTE Link Plugin Dialog

$
0
0

Goal


Show the node name and NOT dc:title or jcr:title in Pathfield widget of Link plugin dialog

Demo | Package Install


Product



Extension



Solution


1) Login to CRXDE Lite, create folder (nt:folder) /apps/eaem-classicui-rte-link-pathfield-show-nodename-not-dctitle

2) Create clientlib (type cq:ClientLibraryFolder/apps/eaem-classicui-rte-link-pathfield-show-nodename-not-dctitle/clientlib and set property categories of String type to cq.widgets and dependencies to underscore

3) Create file ( type nt:file ) /apps/eaem-classicui-rte-link-pathfield-show-nodename-not-dctitle/clientlib/js.txt, add the following

                         show-nodename.js

4) Create file ( type nt:file ) /apps/eaem-classicui-rte-link-pathfield-show-nodename-not-dctitle/clientlib/show-nodename.js, add the following code

(function(){
var EAEM_LINK_DIALOG = CQ.Ext.extend(CQ.form.rte.plugins.LinkDialog, {
constructor: function(config) {
config = config || {};

EAEM_LINK_DIALOG.superclass.constructor.call(this, config);

var pathField = this.findByType("pathfield")[0];

pathField.on("dialogopen", function(){
this.browseDialog.treePanel.on('load', showNodeName);
});

function showNodeName(node){
_.each(node.childNodes, function(childNode){
//set the nodename replacing jcr:title (folders) or dc:title (assets)
childNode.setText(childNode.attributes.name);
});
}
}
});

CQ.Ext.reg("rtelinkdialog", EAEM_LINK_DIALOG);
}());


Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>