Css锚点:AEM锚点链接 css类

我设法在 RTE 中为文本组件显示锚链接选项以进行创作。因为在我们的网站上我们有一个固定的标题,它抵消了锚链接。我可以解决 CSS 的问题,但支持我需要在锚链接上使用 CSS 类。有人可以建议如何在AEM中的锚链接中添加“link-anchor”类?

<links jcr:primaryType="nt:unstructured" features="[modifylink,unlink,anchor]" />
<uiSettings jcr:primaryType="nt:unstructured">
    <cui jcr:primaryType="nt:unstructured">
      <inline jcr:primaryType="nt:unstructured" ="[undo#undo,undo#redo,#paraformat,#styles,-,#format,experience-aem#colorPicker,-,#justify,-,#lists,-,subsuperscript#subscript,subsuperscript#superscript,links#modifylink,links#unlink,links#anchor,edit#cut,edit#copy,edit#paste-plaintext,edit#paste-wordhtml,misctools#specialchars,misctools#sourceedit,-,table#table]">
          <popovers jcr:primaryType="nt:unstructured">
              <format
                  jcr:primaryType="nt:unstructured"
                  items="[format#bold,format#italic,format#underline]"
                  ref="format"/>
              <justify
                  jcr:primaryType="nt:unstructured"
                  items="[justify#justifyleft,justify#justifycenter,justify#justifyright]"
                  ref="justify"/>
              <lists
                  jcr:primaryType="nt:unstructured"
                  items="[lists#unordered,lists#ordered,lists#outdent,lists#indent]"
                  ref="lists"/>
              <styles
                  jcr:primaryType="nt:unstructured"
                  items="styles:getStyles:styles-pulldown"
                  ref="styles"/>
              <paraformat
                  jcr:primaryType="nt:unstructured"
                  items="paraformat:getFormats:paraformat-pulldown"
                  ref="paraformat"/>
          </popovers>
        </inline>
      <dialogFullScreen jcr:primaryType="nt:unstructured" ="[undo#undo,undo#redo,#paraformat,-,#format,experience-aem#colorPicker,-,#justify,-,#lists,-,subsuperscript#subscript,subsuperscript#superscript,links#modifylink,links#unlink,links#anchor,edit#cut,edit#copy,edit#paste-plaintext,edit#paste-wordhtml,misctools#specialchars,misctools#sourceedit,-,table#table]">
        <popovers jcr:primaryType="nt:unstructured">
            <format
                jcr:primaryType="nt:unstructured"
                items="[format#bold,format#italic,format#underline]"
                ref="format"/>
            <justify
                jcr:primaryType="nt:unstructured"
                items="[justify#justifyleft,justify#justifycenter,justify#justifyright]"
                ref="justify"/>
            <lists
                jcr:primaryType="nt:unstructured"
                items="[lists#unordered,lists#ordered,lists#outdent,lists#indent]"
                ref="lists"/>
            <styles
                jcr:primaryType="nt:unstructured"
                items="styles:getStyles:styles-pulldown"
                ref="styles"/>
            <paraformat
                jcr:primaryType="nt:unstructured"
                items="paraformat:getFormats:paraformat-pulldown"
                ref="paraformat"/>
        </popovers>
      </dialogFullScreen>
      <tableEditOptions
          jcr:primaryType="nt:unstructured"
          ="[table#insertcolumn-before,table#insertcolumn-after,table#removecolumn,-,table#insertrow-before,table#insertrow-after,table#removerow,-,table#mergecells-right,table#mergecells-down,table#mergecells,table#splitcell-horizontal,table#splitcell-vertical,-,table#selectrow,table#selectcolumn,-,table#ensureparagraph,-,table#modifytableandcell,table#removetable,-,undo#undo,undo#redo,-,table#exitTableEditing,-]"/>
    </cui>
</uiSettings>
0

你的 usecase 是这个用例的简化版本-http://experience-aem.blogspot.com/2017/09/aem-63-touch-ui-extend-rich-text-link-dialog-add-rel-select.html。而不是添加 drop down 和 2 路映射,你只需要在保存期间硬编码类名。这对我有用:

创建 clientlib-/ apps / myproj / clientlibs / authoring

添加类别cq.authoring.dialog

添加一个新的 js 文件作为 rte-link-cl.js。任何名称,并在 js.txt 中给出相同的名称

在 rte-link-cl.js 中添加以下代码

(function ($) {
  "use strict";
  var _ = window._,
    Cl = window.Cl,
    CUI = window.CUI,
    RTE_LINK_DIALOG = "rtelinkdialog";
  if (CUI.rte.ui.cui.CuiDialogHelper.eaemExtended) {
    return;
  }
  var EAEMLinkBaseDialog = new Cl({
    extend: CUI.rte.ui.cui.CQLinkBaseDialog,
    toString: "EAEMLinkBaseDialog",
    initialize: function (config) {
      this.superCl.initialize.call(this, config);
    },
    dlgToModel: function () {
      this.superCl.dlgToModel.call(this);
      this.objToEdit.attributes["cl"] = "custom-anchor-link";
    },
    dlgFromModel: function () {
      this.superCl.dlgFromModel.call(this);
    },
  });
  CUI.rte.ui.cui.CuiDialogHelper = new Cl({
    extend: CUI.rte.ui.cui.CuiDialogHelper,
    toString: "EAEMCuiDialogHelper",
    instantiateDialog: function (dialogConfig) {
      var type = dialogConfig.type;
      if (type !== RTE_LINK_DIALOG) {
        this.superCl.instantiateDialog.call(this, dialogConfig);
        return;
      }
      var $editable = $(this.editorKernel.getEditContext().root),
        $container = CUI.rte.UIUtils.getUIContainer($editable),
        dialog = new EAEMLinkBaseDialog();
      dialog.attach(dialogConfig, $container, this.editorKernel);
      return dialog;
    },
  });
  CUI.rte.ui.cui.CuiDialogHelper.eaemExtended = true;
})(jQuery);

After adding link from RTE, it gets saved in jcr like this enter image description here

本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处

(790)
网页url是什么:什么是Facebook网页游戏URL
上一篇
超凡先锋怎么选服务器:亚行服务器怎么启动(adb start server)
下一篇

相关推荐

  • css 烟花:烟花灿烂,美景无限

    CSS 烟花是一种使用 CSS 创建的动态效果,它可以模拟真实的烟花效果。通常,它包括一些圆形元素,以及一些 CSS 动画,使这些圆形元素模拟出烟花的效果。…

    2023-01-23 07:08:32
    0 98 32
  • css 背景铺满:欢迎来到我的世界

    CSS 代码如下:上面的代码可以使背景图片填充整个浏览器窗口,并且保持图片的原始比例。…

    2023-02-04 14:45:14
    0 25 40
  • css 不可点击让你的网页更安全!

    CSS 不可点击的方法有两种:使用 pointer-events 属性:…

    2023-03-07 13:35:49
    0 85 27
  • css绝对定位水平居中:标题

    示例示例使用css绝对定位水平居中的方法如下:将元素设置为绝对定位,并将left和right设置为0;…

    2023-02-13 09:11:17
    0 55 65
  • css文字缩进:标题

    CSS文字缩进,可以使用text-indent属性来实现,该属性指定文本块中首行文本的缩进距离。代码示例:…

    2023-02-24 14:03:49
    0 15 38
  • css a下划线:下划线

    CSS a下划线可以使用text-属性来实现,代码如下:…

    2023-02-26 04:05:46
    0 40 24
  • css 时钟:时间在流逝,但美丽永恒

    CSS时钟是一种使用CSS和JavaScript创建的时钟。它可以使用CSS来控制时钟的外观,而JavaScript可以控制时钟的行为。要创建一个CSS时钟,首先需要创建一个div,并将其设置为一个圆形:…

    2023-03-05 13:15:50
    0 92 69
  • css怎么上下居中:标题

    示例示例CSS的上下居中可以通过设置元素的margin属性来实现,具体代码如下:上面的代码将div元素的宽度设置为200px,高度设置为100px,然后设置margin属性,margin-top和margin-bottom属性分别设置为50px,这样就可以将div元素上下居中了。…

    2023-03-15 02:44:32
    0 23 32

发表评论

登录 后才能评论

评论列表(28条)