Why doesn't Elgg's CKEditor have the option for aligning content?

What is the logic for letting the 'AlignLeft', 'AlignCenter', 'AlignRight', 'AlignJustify' buttons out of Elgg's CKeditor? It makes no sense. Why not leave the undo-redo buttons out if it is about lack of space? At least there is keyboard shortcuts for them.

IMO aligning content is one of the most important features for a WYSIWYG editor. Is there any work-around other than that a user has to write their content on word and then paste it onto CKEditor?

  • @Cim, I inserted Table, Anchor, Styles and Format into the toolbar. They work just fine. But for example Smiley, Font, FontSize, AlignLeft, AlignCenter, AlignRight and AlignJustify won't work.

  • Not sure, it could be anything. Did you check your browser's console to see if any JavaScript errors?

  • I have a test which you can see here. http://ridersdepot.net/elgg/blog/view/401/ckeditor-test

    In CKEditor Extended please try replacing your setting with the ones below (please make a backup copy first of your settings).

    toolbar: [['Bold', 'Italic', 'Underline'], ['Strike', 'NumberedList', 'BulletedList', 'Undo', 'Redo', 'Link', 'Unlink', 'Image', 'Blockquote', 'Paste', 'PasteFromWord', 'Maximize'], ['Table', 'HorizontalRule', 'Smiley', 'SpecialChar'],
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], [ 'Styles', 'Format', 'Font', 'FontSize' ]],
    removeButtons: 'Subscript,Superscript', // To have Underline back
    allowedContent: true,
    baseHref: elgg.config.wwwroot,
    removePlugins: 'contextmenu,tabletools,resize',
    defaultLanguage: 'en',
    language: elgg.config.language,
    skin: 'moono',
    uiColor: '#EEEEEE',
    contentsCss: elgg.get_simplecache_url('css', 'elgg/wysiwyg.css'),
    disableNativeSpellChecker: false,
    disableNativeTableHandles: false,
    removeDialogTabs: 'image:advanced;image:Link;link:advanced;link:target',
    autoGrow_maxHeight: $(window).height() - 100,

  • Forgot one rule, try flushing your cache.

  • All these extra features depend on expanding the Htmlawed config to add acceptable elements/attributes/style properties. I see CKeditor Extended reconfigures Htmlawed, but maybe not to the extent necessary.

  • If the HTML it adds is just not in the resulting page after save, that's the problem.

  • Many thanks! Dan's code worked just fine

    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']

    I checked the syntac from here http://docs.ckeditor.com/?_escaped_fragment_=/api/CKEDITOR.config-cfg-removePlugins#!/api/CKEDITOR.config-cfg-justifyClasses and it says

    [ 'AlignLeft', 'AlignCenter', 'AlignRight', 'AlignJustify' ]

     which doesn't work here.

    @Dan, did you just guess the JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock Dan or how did you find it out?

  • Never ask an older fart to remember how they did something. :-) If I recall correctly I copied it from the config.js of another script I use.

Feedback and Planning

Feedback and Planning

Discussions about the past, present, and future of Elgg and this community site.