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

ckeditor.txt doesn't affect toolbars and buttons #80

Closed
apopov-ces opened this issue Mar 2, 2023 · 8 comments
Closed

ckeditor.txt doesn't affect toolbars and buttons #80

apopov-ces opened this issue Mar 2, 2023 · 8 comments

Comments

@apopov-ces
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create strapi app: npx create-strapi-app --ts --quickstart
  2. cd to created directory cd my-strapi-app
  3. Install CKeditor plugin: yarn @_sh/strapi-plugin-ckeditor
  4. Create config/ckeditor.txt and paste there content of https://github.com/nshenderov/strapi-plugin-ckeditor#configuration
  5. Open strapi, create component with RichText field
  6. Create collection type page with dynamic zone that contains RichText component
  7. Open "content manager", create Page with RichText component, ensure CKEditor instantiated on the new field
  8. Stop strapi
  9. Change config/ckeditor.txt, replace toolbar's content (everywhere) with ["bold", "italic"]
  10. Start strapi
  11. Reload page with rich text component editor

Actual behavior
CKeditor's toolbar is unchanged and contains full default set of buttons

Expected behavior
CKeditor contains only "bold" and "italic" buttons

Screenshots
image

please complete the following information:

  • plugins.js (if exist)
does not exist
  • package.json
{
  "name": "my-strapi-project",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi"
  },
  "devDependencies": {},
  "dependencies": {
    "@_sh/strapi-plugin-ckeditor": "^2.0.3",
    "@strapi/plugin-i18n": "4.7.1",
    "@strapi/plugin-users-permissions": "4.7.1",
    "@strapi/strapi": "4.7.1",
    "better-sqlite3": "8.0.1"
  },
  "author": "A Strapi developer",
  "strapi": {
    "uuid": "cd8ef687-7817-422f-9828-7558e0fbe6e5"
  },
  "engines": {
    "node": ">=14.19.1 <=18.x.x",
    "npm": ">=6.0.0"
  },
  "license": "MIT",
  "main": "index.js",
  "keywords": []
}
  • node version
v18.13.0

Additional context
Test repository: https://github.com/apopov-ces/strapi-ckeditor-plugin-config-issue

@StuDownie
Copy link

Had the same confusion setting this up!

At step 5 above - in the component's basic settings: make sure you click the "Choose editor version" field and select "Custom version"

@apopov-ces
Copy link
Author

Thank you for response @StuDownie but I am afraid I haven't field you mentioned:

Basic settings:
image

Advanced settings:
image

@StuDownie
Copy link

That's just the built-in rich text field. When you add a component, choose the "custom" tab at the right to see this custom component

Screenshot 2023-03-02 at 20 28 20

@apopov-ces
Copy link
Author

Thanks, but still nothing on the Custom tab. It is strange that when searching by "ck" it shown only "official" plugin. Anyhow, even if installed it (and it marked as "installed", after strapi restart nothing apears in Custom Tab.

image

image

@apopov-ces
Copy link
Author

It looks like official plugin is more much less customizable, so it cannot be used in my case anyhow. It even doesn't support toolbar adjustements

@javadbat
Copy link

javadbat commented Mar 3, 2023

i have the same problem

@StuDownie
Copy link

That's the official plugin.

Install the one for this repo instead (look for the green icon) https://market.strapi.io/plugins/@_sh-strapi-plugin-ckeditor

It IS customisable.

@apopov-ces
Copy link
Author

Ok, finally I able to make it works. It seems that something was related to my initial setup. Remove node_modules, unistalled packages related to my ckeditor experiments and it works. Steps (for new repo):

  1. Create strapi app: npx create-strapi-app --ts --quickstart .
  2. Install CKeditor plugin: `yarn @_sh/strapi-plugin-ckeditor
  3. Create config/ckeditor.txt and paste there content of https://github.com/nshenderov/strapi-plugin-ckeditor#
  4. Build plugin (crucial step): yarn build (after that it appears in custom components in Strapi)
  5. Open strapi, create component, let's call it "MyRichText":
  • Click "add field"
  • Switch to "custom" tab,
  • Choose "CKEditor 5"
    image
  • Give a name to your field and choose correct editor setup
    image
  • Click "OK" and "Save"

Result: When adding data content field contains only defined buttons on the toolbar.

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

3 participants