-
Notifications
You must be signed in to change notification settings - Fork 25
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
Adding CKEditor Plugins Not Working #119
Comments
#115 |
I'm also seeing this issue, but with the <?php
namespace modules\CKEditorPlugins\web\assets\highlight;
use craft\ckeditor\web\assets\BaseCkeditorPackageAsset;
class HighlightAsset extends BaseCkeditorPackageAsset
{
public $sourcePath = __DIR__ . '/build/38.1.1';
public $js = [
'highlight.js',
];
public array $pluginNames = ['Highlight'];
public array $toolbarItems = ['highlight'];
} This works – I see the highlight toolbar icon in the CKEditor Configs and can drag it into the active toolbar. However, when opening an entry form with the CKEditor field, I get errors and warnings in the console:
I've tried to register the AssetBundle with a higher position to ensure it's loaded after the CKEditor core: Event::on(
CkeditorAsset::class,
CkeditorAsset::EVENT_PUBLISH,
fn () => Craft::$app->view->registerAssetBundle(HighlightAsset::class, 99999),
); This makes the error go away, but the toolbar icon still doesn't show up. Looks like using this approach, the editor is initialized before the plugin script is loaded:
Any ideas @brandonkelly? |
Hi @MoritzLost , I'm also trying to add this plugin (and some others from the first-party packages). Could you give a hint, how did you get the build directory and dll package there? Here in readme is written:
There are no build directories in first-party packages (e.g. https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-highlight), maybe they should be built additionally. I've tried to load the plugin from npm that plugin and to call |
@alexkuzmin You're looking at the source files, those don't include the compiled assets. You need the compiled package from NPM, which contains the npm install @ckeditor/ckeditor5-highlight If you don't have NPM or don't want to have this as a dependency (as you can't really use the npm pack @ckeditor/ckeditor5-highlight
tar -xzvf ckeditor-ckeditor5-highlight-38.1.1.tgz
That's as far as I got – including the plugin works, and it initializes correctly in the config screen, but not in the actual field layout, see the comment above. |
Thanks @MoritzLost , I've got the |
This is now fixed on the bugfix/119-package-plugins branch (db0e950), however the fix required a new event added to Craft (craftcms/cms@a84324c), which I made for the next 4.5 beta release. So I’m going to hold off on merging that change into If you want to test the fix before then, make the following changes to "craftcms/cms": "4.5.x-dev as 4.5.0-beta.2",
"craftcms/ckeditor": "dev-bugfix/119-package-plugins as 3.5.0-alpha", Then run Note that the technique for registering CKEditor packages has changed as well. You no longer need to listen for \craft\ckeditor\Plugin::registerCkeditorPackage(MyAssetBundle::class);
|
CKEditor 3.5.0 is out with that fix 🎉 As mentioned, it requires Craft 4.5.0. |
@brandonkelly Thanks for the update! The highlight plugin is working correctly now 🔆 |
Description
I am trying to use the tables plugin, namely the TableProperties and TableCellProperties features. After following the Adding CKEditor Plugins guide in the README, it seems that there was an issue in the order that the asset bundles interact with each other and the following errors were produced:
And when clicking on a table cell I get
Steps to reproduce
npm install --save @ckeditor/ckeditor5-table
/build
directory from the npm package to the /resources/build directory of your Craft ModuleLoad up the Craft CP and you will see that your table plugin has unssuccessfully been installed.
When looking into the elelment source, it appears that the table.js script is being loaded before the ckeditor5...js scripts.
Please Help!
Additional info
The text was updated successfully, but these errors were encountered: