decoupled_toolbox
Introduction
Decoupled Toolbox contains common features for decoupled websites or even any JSON REST API feed.
It makes use of the Field UI and view displays to expose JSON-formatted
content data on a dedicated path.
It is especially useful for scenarios where content is consumed and served by external rendering services.
Important: it helps only when all you need is to pull content from Drupal. There is no mechanism to push content to Drupal (Please consider using other modules in such case.).
What it is really about
Let's say you have properly configured all your nodes, terms, paragraphs, custom entities in your Drupal backoffice.
Now, you want Drupal to serve its content to some service (be it internal or external). This content needs to be somewhat structured for consumption from the other service, usually as JSON (it could be anything else with relevant modules).
To fulfill this requirement, you will usually use GraphQL, JSON:API, or create custom REST resources. All those methods come with their own advantages and difficulties, and among the most prominent of those difficulties is that they require coding or a good technical grasp of the used method.
What this module offers to the site builder is a way to easily expose the relevant data to the other services. It makes extensive use of the Field API, in a way that what you configure in the display view mode management (the page where you set the field formatters) represents what will be included in the endpoints.
By simply building the entities relationships properly, chosing the public names of the fields and how they are rendered by the formatters, you will get endpoints ready to be consumed in a short time without any code involved.
Please check our documentation if you want more detail on what this module offers!
Requirements
This module has been initially developed on Drupal core 8.8+. May not work on older
versions.
Sub-modules requirements are explicitly defined on each of them.
Installation
Install as you would normally install a contributed Drupal module. Visit https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-mod... for further information.
Interactions with other modules
Here is a list of contrib modules this module supports out of the box.
First and foremost, you may need the Field Display Override module to add any entity values even if they do not appear in the manage display page (like title, ID, created date, etc.).
Fields and pseudo-fields
- Group: add-on for the Group ecosystem
- Group Content Menu: retrieve group content menu items
- Redirect: exposes the entity redirect values
- Color Field
- Duration Field
- Weight
To the programmers: do you want to have more supported field types? Simply check the DecoupledFormatter implementations in the source code. It's easy to add new field types! If it's a contrib module, drop us a note in the issue queue if you want us to reference its Drupal project's home page, or even include it as a submodule.
Filtering results
- Decoupled Router : useful for retrieving content based on aliased paths (see https://www.drupal.org/node/3270819 and https://www.drupal.org/node/3270826)
Tools and helpers
- Open API: visualize your decoupled endpoints with Open API
Documentation
Roadmap
We need YOUR help to work on the roadmap !
- Multilingual support
- Views implementation - both side, with a Views Field Formatter and new Views REST plugin.
- Better documentation
And the best, but most complicated part of the roadmap : do the same with Form Display and be able to create custom writing service.