Skip to content
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

Allow customization of redactor plugins #38

Closed
davist11 opened this issue May 3, 2018 · 13 comments
Closed

Allow customization of redactor plugins #38

davist11 opened this issue May 3, 2018 · 13 comments
Assignees

Comments

@davist11
Copy link

davist11 commented May 3, 2018

The newest version of the Craft Redactor plugin comes with all of the Redactor plugins bundled in it, which is awesome!

But, these plugins don't give you the ability to customize with options passed from the Redactor configs. For example, the inlinestyles plugin, forces you to be locked into the styles provided (unless I'm missing something).

It would be awesome if we could pass in options from the Redactor config JSON files to override these.

@andris-sevcenko andris-sevcenko self-assigned this May 4, 2018
@brandonkelly
Copy link
Member

brandonkelly commented May 6, 2018

It’s up to Imperavi to make their plugins configurable, so I’ll pass this feedback on to them.

That said if you need to make a change to one of the bundled plugins, you can just copy the plugin into your config/redactor/plugins/ folder, and make changes to it there. If the plugin is found in that directory, that one will take precidence over the bundled version.

@davist11
Copy link
Author

davist11 commented May 7, 2018

Ah ok cool, didn't realize that we could make a copy in config/redactor/plugins/. That'll work for now, thanks!

@iMoses
Copy link

iMoses commented May 29, 2018

@brandonkelly I didn't realize it either and it's a great feature!
I recommend adding a reference to it in the README file...

@carlcs
Copy link
Contributor

carlcs commented Jun 9, 2018

@davist11 I wrote the Custom Styles plugin that does exactly what you’re after. Have a look at the example JSON file https://github.com/carlcs/craft-redactorcustomstyles/blob/v3/_examples/redactor/Example.json

@davist11
Copy link
Author

davist11 commented Jul 2, 2018

@carlcs I'm having this same issue with your plugin too:

"button": {
	"args": {
		"tag": "a",
		"class": "button",
		"type": "toggle"
	}
}

2018-07-02 14_44_34

@carlcs
Copy link
Contributor

carlcs commented Jul 3, 2018

@davist11 yeah, I can replicate, it appends a new anchor tag instead of applying the format to the selected tag. Unfortunatelly there’s nothing I can do, as this seems to be a bug with the inline service functions.

https://imperavi.com/redactor/docs/api-services/inline/

@davist11
Copy link
Author

davist11 commented Jul 3, 2018

Yup, that’s what I was experiencing too when creating a direct copy of the plugin file and modifying.

@bryantwells
Copy link

Just wanted to chime in here and second the comment made by @iMoses . Spent the better part of a day trying to put together a craft php plugin to add redactor functionality without knowing about the config/redactor/plugins/ folder. Very convenient! I'm sure a quick line about this in the docs would save a lot of people time @brandonkelly .

@brandonkelly
Copy link
Member

@bryantwells Done: 06fbff6

@nickolasjadams
Copy link

nickolasjadams commented Jul 15, 2020

Is it possible to do a similar thing with the redactor js files?

I want to modify CraftCMS's original configuration for images.

I can modify these lines in vendor/craftcms/redactor/redactor.min.js

imagePosition: !1,
imageResizable: !1,

to

imagePosition: !0,
imageResizable: !0,

to get what I want. But this obviously isn't a good idea because now I can't run updates.

I tried creating a copy here config/redactor/redactor.min.js
But that didn't work. Is there a cool easy way to do this type of thing too?

If not, what do you think would be the easiest solution?

@andris-sevcenko
Copy link
Contributor

Have you tried to set the relevant options in the Redactor config?

@nickolasjadams
Copy link

@andris-sevcenko
Well I don't feel very smart now.
But I'm definitely happy about how stupid easy that was. Thanks!

@andris-sevcenko
Copy link
Contributor

@nickolasjadams I'm just glad you got what you needed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants