0

How do I enable the WYSIWYG editor on a paragraphs text field in Drupal 8?

Currently, adding a text field (of any type) displays a single line input box. I'd like this field to be at least a multi line textarea, with preferably, a WYSIWYG editor. Is there a setting or module I can use to change this ?

EDIT: I should add that the editor works fine in a field on a content type or block. It does not load for any text type in a paragraphs field.

6
  • 1
    It doesn't matter where you add the field, this has nothing to do with paragraphs. In D8 WYSIWYG is included in the standard installation. Did you try this on a fresh install and can you be more specific what is different in your case?
    – 4uk4
    Sep 27, 2017 at 19:41
  • Try to install drupal.org/project/bootstrap_paragraphs module(not a solution for your case), This module define a lot of paragraphs types with WYSIWYG. Sep 27, 2017 at 20:33
  • @4k4 I understand that the WYSIWYG editor is part of core. What I don't get is how I can use that editor on a textfield in a paragraphs entity. All text types don't seem to use it. Sep 27, 2017 at 21:00
  • @4k4 If it isn't clear in my post and my comment, the WYSIWYG editor works fine on a field in a content type or block. It does not load for any of the text types in a paragraph field. That is why I am implying its related to paragraphs. Sep 27, 2017 at 21:09
  • I don't know if it helps, but to be precise, you don't add fields to a paragraph field, but to a paragraphs type the same way as to a content type.
    – 4uk4
    Sep 27, 2017 at 21:24

2 Answers 2

1

If you want to have a multi line textarea with an WYSIWYG editor, you'll have to create, for your paragraph type, a field of type "Text (formatted, long)" and while editing your field, you should choose "Full HTML" as "Text format". Hope this works for you.

5
  • That doesn't work for me. The field is of type text (formatted, long) and field format is Full HTML. Still a single line input textbox. :( Sep 27, 2017 at 22:05
  • @AyexeM Could you check the form display of your paragraph type? There, you can define the widget type and the number of rows. Home >> Administration >> Structure >> Paragraphs types >> My paragraph >> Manage form display (../en/admin/structure/paragraphs_type/my_paragraph/form-display)
    – Rockabelly
    Sep 27, 2017 at 22:14
  • In the form display, I only see an option to change textfield size, which I believe is number of characters in the field. Also, the only option under "widget" is textfield, which I guess is a root cause. Is there a way to enable another widget type that will load the editor? Sep 28, 2017 at 0:32
  • If that's what you see then your widget type is "Text (plain)".
    – Rockabelly
    Sep 28, 2017 at 7:24
  • A very interesting setting that you might want to check is "Text formats and editors": Home >> Administration >> Configuration >> Content authoring (../en/admin/config/content/formats). You could put "Full HTML" on top on the list + verify that the "Anonymous user" does not have access to this format. You could as well define the behavior of your editor per "Text format".
    – Rockabelly
    Sep 28, 2017 at 7:24
0

The field type needs to be "Textarea (formatted, long) with summary" when creating the paragraph type.

2
  • Any formatted text field works, because WYSIWYG depends on text formats, not on paragraphs and not on a field with summary.
    – 4uk4
    Sep 28, 2017 at 6:16
  • @4x4 That is not consistent with my experience. I've even checked with a fresh install of Drupal 8.3.7 with Paragraphs 8.x-1.2. "Textarea (formatted, long) with summary" is the only field type within a paragraphs entity that loads the WYSIWYG. A text field directly in a node works as you describe, but not within a paragraphs entity. Maybe there is a config setting to change this, but I'm not aware of it and that's kinda the entire point of my question. Oct 15, 2017 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.