Providing inline editing

A touted feature of Drupal 8 is the ability to provide inline editing. Inline editing is enabled by default with the standard installation profile through the Quick Edit module. The Quick Edit module allows for editing individual fields while viewing a piece of content and integrates with the Editor module for WYSIWYG editors!

How to do it…

Let's provide inline editing:

  1. Visit a piece of created content.
  2. In order to enable inline editing, you must toggle contextual links on the page by clicking Edit in the upper right of the administrative toolbar:
    How to do it…
  3. This will toggle the contextual links available on the page. Click on the context link next to the content and select Quick edit:
    How to do it…
  4. Hover over the body text and click to Edit.
  5. You can now edit the text with a minimal version of the WYSIWYG editor toolbar.
  6. Once you have changed the text, click Save.
  7. The changes will be saved immediately.

How it works…

The Contextual links module provides privileged users with shortcut links to modify blocks or content. The contextual links are toggled by clicking Edit in the toolbar. The Edit link toggles the visibility of contextual links on the page. Previously, in Drupal 7, contextual links appeared as cogs when a specific region was hovered over.

The Quick Edit module builds on top of the contextual links features. It allows field formatters, which display field data, to describe how they will interact. By default Quick Edit sets this to a form. Clicking on an element will use JavaScript to load a form and save data via AJAX calls.

Quick Edit will not work on administrative pages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset