1

I'm trying to adjust the order of the options in the formatting dropdown menu in the Redactor ii fieldtype but it's not picking up my changes. I have made other changes in this config that have been picked up and working, just not this one.

See below for my Standard.json config file.

{
    buttons: ['format','bold','italic','lists','link','file','image','video'],
    plugins: ['fullscreen','video','table','source'],
    formatting: ['h3', 'p', 'blockquote', 'pre', 'h1', 'h2', 'h4', 'h5'],
    toolbarFixed: true
}
5
  • Works for me. It depends what you're trying to reorder. Changing the order of the buttons array works, but plugins seem to appear randomly. Mar 16 '16 at 15:40
  • @ElliotLewis In the config above, i have set the h3 tag to be first, but when the field is rendered, the options haven't changed order at all. Are you saying that your formatting options are in the order as above?
    – John
    Mar 16 '16 at 15:50
  • I can't add an image to a comment so posted below. Mar 16 '16 at 18:33
  • @ElliotLewis OP is talking about the "Format" dropdown. And buttons added from a plugin are positioned with the addAfter API.
    – carlcs
    Mar 16 '16 at 19:09
  • @carlcs Ah sorry, a good answer to the wrong question! I've up-voted the right answer. Mar 17 '16 at 9:18
3

Looks like the Redactor formatting config setting only affects what shows up or not from Redactor's default's of ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5'].

Can't say whether that's a bug or intended behavior, but you could probably set the defaults to empty [], then add them back in the order you want with formattingAdd.

5
  • That works. I usually set formatting to ['p', 'blockquote'] and add my headings with formattingAdd.
    – carlcs
    Mar 16 '16 at 19:00
  • @carlcs Have you got a code sample for using formattingAdd in this way? I'm not having much luck with mine for some reason?
    – John
    Mar 17 '16 at 12:56
  • @John the example in the formattingAdd doc doesn't work for you?
    – carlcs
    Mar 17 '16 at 12:58
  • @carlcs No! I'm trying: formattingAdd: [ { "title": "h3", "tag": "h3", "class": "" } - but it's erroring out the js in the entry form.
    – John
    Mar 17 '16 at 13:01
  • @carlcs Looks like the syntax is different than i thought. All working now though, thanks!
    – John
    Mar 17 '16 at 13:16
0

Here's what I get with a redactor JSON config.

Redactor config examples

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.