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

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


javascript - 如何将CKEditor自定义配置文件添加到XPages?-LMLPHP

<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”?

最佳答案

<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部分是当前数据库的路径。

07-24 09:38
查看更多