Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Redactor customization

I would like to add "fontsize" button and dropdown to redactor editor but it not so simple as expected.

The plugin seems to be present, how can I use it?

Would it be possible to use the unit "em" instead of "px" by editing fontsize.js? Thanks for help.

Comments

  • My rationale for keeping font size, family, and colour disabled is that they enable less technical users to create content that is mismatched and inconsistent with the rest of the website, by allowing them to override the site's stylesheet anywhere they want. So I try to design stylesheets in such a way that users don't need to go outside of what they offer.

    To enable the plugin, you'll have to edit apps/admin/handlers/util/wysiwyg.php to add the include call, and apps/admin/views/util/wysiwyg.html to add it to the list of plugins. The plugin source code looks pretty straight-forward, so you could change it to use 'em' instead of 'px' fairly easily.

    If I may offer an alternative to fontsize, you can add additional styles via Redactor's formattingAdd setting, which defines custom styles to be added to the formatting dropdown along with the usual p, blockquote, pre, and h1-h6. It would still take modifying apps/admin/views/util/wysiwyg.html, but it may offer more customization without letting users stray too far into Comic Sans land ;)

    Anyway, hope that helps :)

  • I totally agree your rationale and I'm loath having to add fontsize fearing the outcome. Add additional styles was my first option but I was not able even to add h6 that should be easier.

  • I was able to add fontSize with em units but not to add styles.

    Could it be a version problem?

    From this page http://imperavi.com/redactor/log/ it seems formattingAdd was introduced with version 10 while I'm using the 9.1.9

    Thanks.

  • Ah yes, that would be the issue. I have a Redactor 10 upgrade almost ready. I may look at making some of its settings easier to change too.

Sign In or Register to comment.