Drupal Planet

Display forms in a modal dialog with Drupal 8

Drupal 8 has a great AJAX form API which includes some tools to create modal dialogs using the jQuery modal library. The Examples module even demonstrates how to create a custom form and display it in a modal window. But what if what you want to do is display an already created form in a modal? How do we do that? Let's see how to do it with an example. Let's display the node add form in a modal window.

Conditional fields in Paragraphs using the Javascript States API for Drupal 8

While creating content, there are pieces of information that are only relevant when other fields have a certain value. For example, if we want to allow the user to upload either an image or a video, but not both, you can have another field for the user to select which type of media they want to upload. In these scenarios, the Javascript States API for Drupal 8 can be used to conditionally hide and show the input elements for image and video conditionally.

Using CKEditor plugins in Drupal 8

CKEditor is well-known software with a big community behind it and it already has a ton of useful plugins ready to be used. It is the first and only WYSIWYG text editor to ship with Drupal 8 core. Unfortunately, the many plugins provided by the CKEditor community can't be used directly in the CKEditor that comes with Drupal 8. It is necessary to let Drupal know that we are going to add a new button to the CKEditor.

Learn with dinarcon in his upcoming Drupal tour

In the next few weeks, Mauricio Dinarte (dinarcon on drupal.org) will be traveling to deliver his expertise to multiple Drupal events in Europe and America. He is on a mission to continue sharing the knowledge gained from many years as an active member of the Drupal community. Over the last few years he has presented numerous sessions and full day trainings at more than 18 Drupal camp— so you may have been at one of his presentations about Drupal basic concepts, twig recipes, or D8 migrations!