5

In craft/config/redactor you can either add your own setting file, or edit one of the ones already there. If you add the following JSON: "formattingAdd": [ { "tag": "sup", "title": "Superscript" } ] You will have access to a Superscript choice under the Formatting buttons dropdown menu. This will wrap the selected text in a <sup> tag. ...


4

After several iterations I came up with this that works. But still puzzled as when to use [ ] or { }. { "buttons": ["html","undo","format","bold","lists","link","file"], "plugins": ["fullscreen","table","video"], "formatting": ["p"], "formattingAdd": { "heading": { "title": "Heading", "api": "module.block....


4

Per their configuration docs, which also link to Craft's docs on the subject, it looks like you'd just need to add "alignment" to the plugins portion of one of your craft/config/redactor/ JSON config files. i.e. { "plugins": ["alignment"] } Then whatever config you end up modifying, you'll want to make sure that config is selected under that field's ...


4

I had a similar problem so created a plugin to add some of these extras to Redactor. Redactor Extras for Craft https://github.com/elliotlewis/Redactor-Extras Available plugin are: Superscript and Subscript Word count Alignment Custom plugin


2

A better way to tackle something like this would be to use a matrix instead of just a rich text area. With a matrix you can have an image block and then in your template you can pull any info you want from the images custom fields. We normally have at least three block types with a normal matrix, text, image, and gallery. Text is just a refactor text ...


2

This complexity is no longer necessary in Craft 3. You can simply add "sup" to your buttons array in your redactor config.


2

The best way I assume would be to use the formattingAdd (see documentation https://imperavi.com/redactor/docs/settings/formatting/#s-formattingadd) You can find that json file inside config/redactor/*.json. In my example i am using "formattingAdd": { "superscript": { "title": "Superscript", "api": "module.inline.format", ...


2

It appears that Craft filters out <span> tags by default. You can control this in two ways: By disabling the "Clean up HTML" setting applied to the custom field For more control, you can create your own custom redactor config JSON file. It's discussed in the docs here: https://craftcms.com/docs/rich-text-fields#redactor-configs


1

i have tested it with the latest Craft 3 version and it works if everything is in double quotes: { "buttons": ["format","bold","lists","link","file"], "plugins": ["fullscreen","table","video"], "formatting": ["p"], "formattingAdd": { "heading": { "title": "Heading", "args": ["h2"] }, "sub-...


1

In case anyone runs into this issue and finds the Redactor-Extras plugin isn't working, this plugin by Doug Thwaites worked for me: https://github.com/DougThwaites/CraftRedactorFontAlignment


1

The definitive and most simple answer for all Redactor Inline Styles requests is this great plugin from carlcs: https://github.com/carlcs/craft-redactorinlinestyles


1

Craft 2.3 upgraded Redactor to version 10, which comes with a completely new API for plugins. This broke RedactorStyles which relied on the old API. I've updated the plugin now, so downloading version 0.3 should make it work with Craft 2.3. Beware that the plugin isn't 100% backwards compatible, due to changes in Redactor and its API, so read the docs.


1

This isn't an answer, but I can't comment yet. Craft is out-of-sync with the current version of the Redactor docs. Redactor is on version 10, while the latest Craft build is still on version 9.2.6. There were a number of breaking changes and additions to version 10 of Redactor, but for some reason Redactor does not maintain a docs archive. So for the ...


1

I had a similar problem and ended up creating my own fieldtype that extended a RichText field. I think there is an oversight in Craft, where additional Redactor plugins aren't loaded even if they are specified in the config.json. But perhaps I'm missing something too? A simple solution would be to hardcode the loading of the plugin in craft/app/fieldtypes/...


1

I made another pretty easy solution: {{ entry.redactor | nl2br | replace({'/m3': '/m<sup>3</sup>'}) | raw }} It just replaces the units with the coresponding html markup. It works nice :) But you need to know which units are used.


Only top voted, non community-wiki answers of a minimum length are eligible