Drupal 8: Entity Embed Module

Entity Embed is a module created for Drupal 8 by Chandan Singh for his Google Summer of Code 2014 project. It allows you to embed any type of entity such as Content, Comment, and Role. This blog post was made for Google Code-In 2014 to test and review Entity Embed.

Installation

The module was easily cloned into /modules/contrib/ from the GitHub Repository. From there, the module was activated. An error occurred while installing, which resulted in a blank white screen. Although, I was notified by Chandan Singh that this is a known error, and in spite of the error, the module should work fine. After a refresh, the module seemed to be installed, and no error was seen. The install process was easy, however the error might worry a user.

Configuration

Configuring the module was fairly straightforward. An Embed Button needs to be created for each entity type wished to be used in CKEditor. Once the buttons have been created, they can be added to the CKEditor interface in “Text formats and editors”.

entity-embed-ckeditor-config

As it is right now, it is beneficial for those who will use this module to embed only certain entity types since there is one button for a single entity type, however for people who want to embed many entity types it will be difficult to distinguish between the buttons since they all have the same icon. Although an icon/image can be uploaded for the buttons, they might not know how to make the icons.

Usage

Using Entity Embed in CKEditor while creating a new article or page was very simple. After clicking the “E” button, typing in the title of the entity, and configuring, the entity could be seen in the WYSIWYG editor.

Entity Embed Edit Content

One improvement for user interface is to keep the title in the box and load the ID/UUID in the background instead of showing the ID/UUID in the textbox. Also, some “Display as:” values show the same content in the editor. For example, both “Author” and “Label” show the title of the entity. Issue Reported Here. “Display as:” problem relates to another module.

Entity Embed Embedded First Post

Conclusion

Overall, Entity Embed is a great plugin! It can easily be used to embed any type of entity into the WYSIWYG CKEditor in Drupal 8. With some improvements here and there Entity Embed can be perfected!

Author: Akshay Kalose

A teenager, who is interested in Computer Science, Information Technology, Programming, Web Designing, Engineering and Physical Sciences.

Leave a Reply

Your email address will not be published. Required fields are marked *