Displaying snippets
Last updated on
22 July 2018
Pages
TBD
Block
TBD
Display variant
TBD
Layout
TBD
Entity reference field
TBD
Views area
TBD
Formatted text
If you enable Snippet filter plugin in text format configuration you can make use of snippet tokens which may look like follows: [snippet:example]
.
Twig template
{{ snippet('example') }}
Programmatically
$entity_type_manager = \Drupal::entityTypeManager();
$snippet = $entity_type_manager->getStorage('snippet')->load('example');
$build = $entity_type_manager->getViewBuilder('snippet')->view($snippet);
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion