gpt4 book ai didi

aem - 是否可以在 AEM 组件的工具栏上添加自定义按钮?

转载 作者:行者123 更新时间:2023-12-04 00:59:24 28 4
gpt4 key购买 nike

enter image description here

在AEM 6.5的编辑模式下,如果我点击一个组件,会弹出上面的工具栏。除了通过在 CRXDE 上创建 cq:dialog 节点来添加对话框( Spanner 按钮)之外,您可以在工具栏上创建自定义按钮吗?如果是这样,我可以在网上找到哪些工作示例?

最佳答案

是的,你可以做到这一点。

您将需要使用 JS 文件创建一个自定义客户端库,该文件在工具栏中注册按钮:

(function ($document, author) {
var openDialog = {
icon: 'coral-Icon--game',
text: 'Open Dialog',
handler: function (editable, param, target) {
author.DialogFrame.openDialog(new author.edit.Dialog(editable));
},
condition: function (editable) {
//show this action only for component type eaem-touchui-open-comp-dialog-register-action/touchui-open-component-dialog
return editable.type === "eaem-touchui-open-comp-dialog-register-action/touchui-open-component-dialog";
},
isNonMulti: true
};

$document.on('cq-layer-activated', function (ev) {
if (ev.layer === 'Edit') {
author.EditorFrame.editableToolbar.registerAction('EAEM_OPEN_DIALOG', openDialog);
}
});
})($(document), Granite.author);

您可以自定义图标、文本、按钮的行为,并决定此工具栏自定义对哪些组件可见。

source

关于aem - 是否可以在 AEM 组件的工具栏上添加自定义按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59831235/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com