Questions tagged as ['wysiwyg']

Use it for questions about the WYSIWYG editors made available in Drupal.
Score: 1
Matt avatar
How to add new fields to the 'edit media' dialog box on media embeds
cn flag

I'm attempting to add a new select box to the dialog box that pops up when choosing 'edit media' on a media embed in a WYSIWYG. I'm referring to the dialog box that presents options like 'caption' and 'alignment'

I was able to make the field appear by using

function mymodule_form_alter(array &$form, FormStateInterface $form_state, string $form_id)  {
if($form_id=='editor_media_dialog'){
  $form['s ...
Score: 0
pmagunia avatar
Module for CKEditor that provides a button to check for broken links
au flag

Are there any modules for Drupal 9 that provide a button for CKeditor that allows the user to check for broken links before saving the content?

I imagine it working like this:

  1. The user goes to a node and begins to add or edit text in a textarea
  2. After the user enters text, the user can go to the CKEditor toolbar and click a button to check links they have entered to see if they return HTTP 404 responses.
Score: 0
Ckeditor does not show the latest image
kr flag

I have a media item that is displayed in the body field with Ckeditor with the following markup.

<drupal-media data-align="center" data-entity-type="media" data-entity-uuid="8037391d-5a84-4ced-a88d-587fccc013bf"></drupal-media>

I edited the media item and replaced the image, but the node edit form is still showing the old image, in the preview. The node page shows the correct image, though. ...

Score: 0
Linkit Module - Pointing the link's title attribute to a custom field. Hook available?
us flag

Currently the Linkit module delivers the link's title attribute by pulling the related node's title field.

We would like it to point to another field in the node.

How can we achieve this?

I looked into Editor Advanced Link module, but I need this to be automatic, and my custom field changes based on content type.

Maybe someone has a hook idea?

Score: 1
Sarah C avatar
How to change the CKeditor button for media library module
za flag

The Drupal 9 Media Library includes a button for CKeditor. The button depicts an image icon combined with musical notes. We plan to only use this button for video. How can I replace this button with one of our own design?

Score: 1
Joost avatar
Make table fully accessible use CKEditor 4.17.1
jp flag

I'm working on a website that needs to be fully accessible following the WCAG guidelines. Therefor I need my table output, created via the CKEditor 4.17.1 in Drupal 9, to be set with the scope attribute.

Something like this:

<table>
  <caption>Reiskosten</caption>
  <tr>
    <td></td>
    <th scope="col">2e klas</th>
    <th scope="col">1e klas< ...
Score: 0
Drupal 7 and/or CKEditor adding paragraphs to code breaking styling
th flag

I've recently started a new job where I'm managing a Drupal 7 website for the first time. We will be moving away from this platform soon, but I have to maintain this site for the time being.

I'm trying to add a new form to one of our pages, but paragraph tags are being added after saving the code in the CKEditor which is breaking my styling.

Here is the relevant code added to CKEditor with rich text ...

Score: 1
Existing pages not editable for admin with all permissions
dz flag

You know the drill. User of various CMSs but new to Drupal and inherited a site running version 8.6.10. New pages (nodes?) can be created but once something is created, nothing on/under the Edit tab is editable. In watching various Drupal tutorials, it appears most users with the correct permissions can simply click on a page from Content, click the Edit tab and edit the content boxes on the page. This  ...

Score: 1
Migrating Wysiwyg/Ckeditor embedded images to embeded images
eg flag

I am migrating a Drupal 7 site that is using: drupal/wysiwyg:^2.9' (plus the ckeditor library) drupal/media:^2.27' drupal/media_ckeditor:^2.14'

In Drupal 7, when you insert an image into the wysiwyg body. The source code looks like this.

[[{"type":"media","view_mode":"media_large","fid":"532","field_deltas":{"1": 
{}},"link_text":null,"fields":{},"attributes":{"alt":"Image of a hand","height":"238","w ...
Score: 0
DeveloperWeeks avatar
CKEditor hides from my testing tool
ch flag

I am building an automated testing tool for the drupal site that I maintain. The site has migrated to D9 and functions normally for a human user. When my python scripts pull up selenium/Chrome browser and go to the Create Content Page page, CKEditor does not process the body field.
I open my chrome browser and sign in with the same credentials and CKEditor appears.

My python bot is able to create nod ...

Score: 2
Yuseferi avatar
Enable image resizer for all images in the ckeditor
cg flag

I'm using Drupal 9.2.9,

I have some migrated content that comes from an external source. there are some <img tags,

the Ckeditor image resizer is working for the images I insert into the editor the upload icon but for the images that come from the content migration, the resizer is not enabled.

enter image description here

I even tried to add height manually to the <img tag but nothing appear.

the question is that, how can I ena ...

Score: 0
José Luis avatar
WYSIWYG images in AMP Module
in flag

I have a Drupal 7 website, the site has AMP module installed. When I insert a image in WYSIWYG editor the site is not converted to AMP mobile version (in image fields there is no problem).How can I fix this issue?

Score: 1
Ryan Brownell avatar
Display WYSIWYG editor group names to endusers modifying content
gw flag

When one is editing the Toolbar Configuration in a Text Format in Drupal 8, group names can be added to the editor as part of grouping the buttons in the toolbar.

Is it possible to expose those group names to endusers who use the editor to edit content? If so, how?

Score: 0
Can't open url link or images in CKEditor on a modal form
ni flag

I have created a custom form with a text field that uses ckeditor. I open this form in a modal window. It works good, but if you try to use url link button or image button, because they are opened in a modal window too, my form disapears.
I open the form using this code:

var ajaxSettings = {
            url: '/' + path + '/' + id + '/edit',
            dialogType: 'modal',
            dialog: {classes: { ...
Score: 0
Michael Von Bargen avatar
Ckeditor inline images path
fr flag

I am running a Drupal 9 site and I expect my users to upload a lot of files with the ckeditor functionality. All of those files will be stored in a single folder.

I heard that this will cause performance issue once there are a lot of files. To avoid this, I would like to include a timestamp in to the path where to file will be stored, similar to what Drupal does to regular file uploads.

Is there a w ...

Score: 0
Add custom buttons to TinyMCE editor toolbar
cn flag

I'm trying to add a custom button to my TinyMCE editor in Wysiwyg on a Drupal 7 install.

I've managed to adapt TinyMCE settings to work in my custom module, like so:

function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'tinymce')
  if ($context['profile']->format == 'filtered_html') {
    $settings['browser_spellcheck'] = TRUE;
    $set ...
Score: 1
Anthony Tailor avatar
Disable source code formatting in CkEditor
ua flag

In Drupal 9, is there a way to avoid CkEditor re-formats the source code?

There is one text editing mode set in Drupal, Full HTML. When I edit or create a Basic page node, once I click the Source button, paste in code, deselect Source, and then re-select Source, the formatted code becomes CkEditor-ified.

I only found posts from years ago or that aren't for Drupal 9. I've tried the CkEditor Config modul ...

Score: 1
Tobias Krause avatar
Remove a button from CKEditor based on the role of the current user
cn flag

I have a text format which should access by user role A and the admins but I only want the admins to see the "Source code" button. User's of the role A should not see this button but they should be able to use the exact same text format. Is there a way to achieve that without defining a new text format and handling all the text format during form building and entity saving?!

Score: 0
Matt avatar
Syntax for adding content inside group in Gutenberg json template
cn flag

I'm using Gutenberg on Drupal 9. When editing the Gutenberg JSON template for a content type I'm able to add placeholder headings and groups like so

[
["core/heading",{"placeholder":"Title Goes Here"}],
["core/group",{}]
]

However I want to put placeholder content inside the 'core/group' component. I've tried several variations including the following

["core/group",{'placeholder':'<h2>Headi ...
Score: 0
Unable to preview media items
kr flag

I have a node page where, in the WYSIWYG, I have embedded about 50 media items. When I edit the node, I can see this error for some of the media items.

An error occurred while trying to preview the media. Please save your work and reload this page.

In the browser console, the error is the following.

mysite.com/media/wysiwyg/preview?text=%3Cdrupal-media%20data-entity-type%3D%22media%22%20data-entity-uui ...

Score: 0
How to allow &thinsp; (and other HTML entities) in ckeditor?
ru flag

Our customer want to be able to add thin spaces in addition of non breaking spaces. But when we try to add the character &thinsp; in source of ckeditor, ckeditor doesn't keep it and convert it as a basic space.

After research, it seems ckeditor allow the entity &thinsp;. I don't know if I have a configuration which prohibit this (I tested with full html profile with non html correction, that' ...