Left, Center, Right -- Can the text alignment button be added to Redactor 2, and if so, how?
You can use the formattingAdd
config setting to add custom formatting to the "Format" dropdown.
formattingAdd: {
"align-left": {
"title": "Align left",
"args": ["p","class","align-left"],
},
"align-right": {
"title": "Align right",
"args": ["p","class","align-right"],
},
"align-center": {
"title": "Align center",
"args": ["p","class","align-center"],
},
"align-justify": {
"title": "Justify",
"args": ["p","class","align-justify"],
},
},
If you want to have a separate dropdown or individual buttons in the toolbar for this functionality, have a look at my plugin Redactor Inline Styles.
-
carlcs - After a comparison, I would recommend your RedactorInlineStyles plugin to anyone wanting to return Redactor within Craft to its former glory. The documentation and examples you include with the plugin are great and really made it easy to configure. – Davis Harrison Dion Jan 21 '16 at 15:58
Either existing answer could work.
Another option is a plugin I've recently built. Redactor Extras: https://github.com/elliotlewis/Redactor-Extras
Uses the Plugin from Redactors site for align. Has other extras as well.
-
great plugin. quick and easy to install and get stuff happening. thanks! – bhu Boue vidya May 10 '17 at 1:10
Thank you.
I also discovered this plugin which allows the addition of styles to the redactor editor.
RedactorStyleIt