Questions tagged as ['wysiwyg']
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 ...
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:
- The user goes to a node and begins to add or edit text in a textarea
- 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.

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. ...

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?
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?
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< ...

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 ...

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 ...

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 ...
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 ...
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.
I even tried to add height
manually to the <img
tag but nothing appear.
the question is that, how can I ena ...
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?
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?

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: { ...
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 ...

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 ...
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 ...
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?!
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 ...

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 ...

Our customer want to be able to add thin spaces in addition of non breaking spaces. But when we try to add the character  
in source of ckeditor, ckeditor doesn't keep it and convert it as a basic space.
After research, it seems ckeditor allow the entity  
. I don't know if I have a configuration which prohibit this (I tested with full html profile with non html correction, that' ...