-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is Redactor trying to order my plugins? #218
Comments
Those are plugins provided by Redactor, so not sure how smart it would be to tamper with that code. |
Huh, I assumed that was just Craft's implementation of those libraries. It's odd that Redactor would be so strict about where those buttons will appear... isn't the entire point of Redactor its flexibility? Is there any way to override that? I find it hard to believe that a Table button must go next to a Link button, no exceptions. 😕 |
It's probably possible to override that with some JS code, but, if we're going to tamper with this, let's do it right. If you wanted to insert the table button in the middle there - how would you expect to define this in the config? |
Hmm... that's a great question, because Redactor is already squirrely about how you arrange the buttons. Ideally, we'd be able to use the https://imperavi.com/redactor/docs/settings/button/#s-buttonsaddafter But worst case scenario, I'd just expect it to land exactly where I put it in the
|
@lindseydiloreto what I meant is how would you insert it between the bold and italic buttons, for example? |
Are you asking "how do I envision it working?" Maybe something like this... "buttonsAddAfter": {
"after": "bold",
"buttons": ["table"] // Places the plugin button
},
"plugins": [
"table" // Loads the plugin
], ... or possibly like this... "pluginsAddAfter": {
"after": "bold",
"buttons": ["table"] // Loads & places the button
}, I have no idea how easily that jives with what Redactor and/or the Craft plugin are already doing. Glancing at this commit, it seems that the Craft plugin occasionally needs to use brute force with Redactor anyway. Let me know your thoughts, or if I completely misunderstood the question! 😄 |
It is really weird that redactor isn't able to just order the buttons like they are defined in the array. It is the default behaviour I would expect when defining buttons. Considering that redactor is a paid tool I would wish for more flexibility and predictability. |
Took me a few months, but the solution is finally here in the form of a brand new |
(With the next release) |
Ahh, brilliant @andris-sevcenko! Thanks so much for nailing that down, my OCD will be much happier for it. 😄 Can't wait to take it for a spin! 🍺 |
For a few of the plugins being added automatically, they are telling Redactor to
addButtonBefore
oraddButtonAfter
another specific button...It feels like the Craft plugin shouldn't be making decisions as to what order our Redactor plugins show up. Ideally, they would just appear in whatever order I have them listed in the JSON file.
Because the Craft plugin is making these decisions, it's leading to strange behavior in my custom toolbar. When I add a plugin (for example
table
), it automatically places itself in the toolbar in a specific position. It's confusing because the plugin button ends up not where I placed it.Can we please remove the preset order preferences? Or somehow make them overridable?
The text was updated successfully, but these errors were encountered: