Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixing some broken formatting

...

  1. Per instance configuration: If there is need to make a change for a particular instance of the CKEditor component this can be acheved by using the parameters parameter of the mixin, which is of type Map<String, ?>. Example:

    Code Block
    titletapestry-ckeditor example
    languagehtml/xml
    <t:form>
     <t:textarea t:mixins="tynamo/ckeditor" parameters="{'toolbar': 'Full'}" />
    </t:form>

     

     

  2. Global configuration: Changes of the CKEDITOR.config object  are reflected in all editor instances, if not specified otherwise for a particular instance. the configuration can be made in a separate js file that is used by setting the CKEDITOR.config.customConfig property. Example: 

    Code Block
    titleconfig.js
    languagehtml/xml
    CKEDITOR.editorConfig = function( config )
    {
    	// Define changes to default configuration here. For example:
    	config.toolbar = 'Basic';
    };
    
    
    Code Block
    titleMyPage.tml
    languagehtml/xml
    <t:form>
     <t:textarea t:mixins="tynamo/ckeditor" parameters="prop:CKEditorParameters" />
    </t:form>
    Code Block
    titleMyPage.java
    languagejavascript
    public class MyPage
    {
        @Inject	@Inject
    	@Path("config.js")
    	private Asset config;
     
    	public Map<String, Object> getCKEditorParameters()
    	{
    		Map<String, Object> map = new HashMap<String, Object>();
    		map.put("customConfig", config.toClientURL());
    		return map;
    	}
    }