javascriptdojockeditorxpagesssjs

How to add a CKEditor custom config file to XPages?


I am trying to add a custom config file to all the RichText items in my application but I can't figure out how to refernce the config file correctly in the dojo attribute. I want to reference it releative to the database.

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

enter image description here

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

In my example above the config file is referenced to: http://server/xsp/.ibmxspres/domino/ckeditor/cke_custom_config.js?t=G44E

How can I change the path to the config file to point to "WebContent/cke_custom_config.js" ?


Solution

  • <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>
    

    The EL part added before the cke_custom_config.js?open is the path to the current database.