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

Can't add additional Redactor plugins to Craft3 with custom config #14

Closed
Teun87 opened this issue Feb 28, 2018 · 6 comments
Closed

Can't add additional Redactor plugins to Craft3 with custom config #14

Teun87 opened this issue Feb 28, 2018 · 6 comments

Comments

@Teun87
Copy link

Teun87 commented Feb 28, 2018

I'm using Craft CMS 3.0.0-RC13 and Redactor 2.7 (latest versions I could pull in with Composer).

I've added 3 extra JS plugins: clips, inlinestyle and specialchars. Everything is copied (JS/CSS) to the /config/redactor/plugins folder. Names are matching. For example: /config/redactor/plugins/specialchars.js

Afterwards I've set up a custom config "extended.json" in /config/redactor:

{
  "buttons": ["formatting", "bold", "italic", "unorderedlist", "orderedlist", "link", "image", "video"],
  "plugins": ["source", "fullscreen", "video", "clips", "inlinestyle", "specialchars"],
  "toolbarFixed": true,
}

The problem is, Craft seem to recognize them (when I spell the name of one plugin false on purpose, I get an error in Craft), but I can't get them visible as buttons.

@xavianaxw
Copy link

Craft throws a Redactor is not defined error

@mattandrews
Copy link

Not sure if this helps, but I was just trying to add my own (basic) Redactor plugin and was also getting a Redactor is not defined error. I was using some example plugin code from Redactor's website but realised it was from v3 which I think Craft isn't using (yet?).

I looked at the other existing plugins and they're initialised jQuery-style, so this code worked for me:

(function($)
{
	$.Redactor.prototype.myPlugin = function()
	{
		return {
			langs: {
				en: {
					"myPlugin": "My Plugin"
				}
			},
			init: function()
			{
				console.log('Hello, world');
			}
		};
	};
})(jQuery);

@xavianaxw
Copy link

I saw this as well while digging through the source code. I guess we'll have to thinker them on our own for now to make it work.

Gonna try to get limiter and counter to work so if anyone need it I can hook you up once I'm done. Not for now though :)

@howells
Copy link

howells commented Mar 28, 2018

I have the same issue: did you guys figure out how to fix it in the short term?

@xavianaxw
Copy link

Sorry @howells that's a no from me

@brandonkelly
Copy link
Member

Didn’t realize that Imperavi removed all the Redactor 2 plugins from their site when Redactor 3 launched. As of the next release, the plugin will come bundled with all of Imperavi’s Redactor 2 plugins.

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

5 participants