drupal microcontent cheatsheet
Microcontent
Microcontent is a drupal module for usable fragments of content that can be configured to display throughout your site.
- Microcontent is a module
- Microcontent is the blueprint for reusable content
- Reference peices of microcontent from paragraphs module ie: a
Cards
paragraph module will reference severalcard
microcontent to form a collection of cards. - When working with microcontent and paragraphs - create the microcontent first and then the paragraph block to reference it.
** Tips **
- Sometimes its best to set the paragraphs to locate the microcontent via checkboxes rather then autocomplete as the user may not know what options are available
** Trouble Shooting **
Paragraphs not finding the microcontent?
- Ensure the label is not disabled or hidden in the field display settings. By default the reference field locats content via the label
Display
- Configure the display of microcontent in the admin by disabling fields in the manage display
Frontend
By default the Microcontent you reference display as links to the content. This is not useful. What we need is the full content to display.
Install entity reference display module
1
2
ddev composer require 'drupal/entity_reference_display:^2.0'
ddev drush en entity_reference_display
Display the full block content
- Go to structure / content types
- Select your paragraph type
- Go to
manage fields
- Add
reference
field ofdisplay mode
- Create a display mode
- Hit save on the following screen
On the following edit field screen, under excluded display modes
- Choose
full
- Choose
include selected display modes
- Save settings
Set the entity reference field display mode
Go back to manage fields (use the breadcrumbs at the top of the screen)
- Under
manage display
- Locate the
entity reference field
- Under the format column choose
selected display mode
- Hit save
Now back on the frontend, rather then the block displaying a link to edit its content it will display the full content
This post is licensed under
CC BY 4.0
by the author.