【问题标题】:How to add a CKEditor custom config file to XPages?如何将 CKEditor 自定义配置文件添加到 XPages?
【发布时间】:2017-10-18 06:13:19
【问题描述】:

我正在尝试将自定义配置文件添加到我的应用程序中的所有 RichText 项目,但我无法弄清楚如何在 dojo 属性中正确引用配置文件。我想引用它与数据库相关的内容。

<xp:dojoAttribute name="customConfig" value="cke_custom_config.js"></xp:dojoAttribute>

<xp:inputRichText id="inputRichText2" value="#{cd.Body}">
  <xp:this.dojoAttributes>
    <xp:dojoAttribute name="customConfig" value="cke_custom_config.js"></xp:dojoAttribute>
  </xp:this.dojoAttributes>
</xp:inputRichText>

在我上面的示例中,配置文件被引用到: http://server/xsp/.ibmxspres/domino/ckeditor/cke_custom_config.js?t=G44E

如何更改配置文件的路径以指向“WebContent/cke_custom_config.js”?

【问题讨论】:

    标签: javascript dojo ckeditor xpages ssjs


    【解决方案1】:
    <xp:inputRichText id="inputRichTextBody"
        value="#{cd.Body}">
        <xp:this.dojoAttributes>
            <xp:dojoAttribute name="customConfig"
                value="${facesContext.externalContext.request.contextPath}/cke_custom_config.js?open">
            </xp:dojoAttribute>
        </xp:this.dojoAttributes>
    </xp:inputRichText>
    

    cke_custom_config.js?open之前添加的EL部分是当前数据库的路径。

    【讨论】:

    • 谢谢。为什么要去掉时间戳,是为了防止缓存吗?
    • 我认为如果使用“cke_custom_config.js?open”参数会起作用
    • @ThomasAdrian:好的,改变了我的答案
    猜你喜欢
    • 2017-12-29
    • 1970-01-01
    • 1970-01-01
    • 2020-02-27
    • 1970-01-01
    • 1970-01-01
    • 2012-09-20
    • 1970-01-01
    • 2016-12-04
    相关资源
    最近更新 更多