Module Paragraphs
Cf Paragraphs (démo) - Doc drupal 7 (et mes notes) et drupal 8.
Pour drupal 8
Requiert https://www.drupal.org/project/entity_reference_revisions ; fonctionne bien avec le Module entity_ref_tab_formatter
Test sur pi (druc2).
- Création d'un type de Paragraph (ici imggch) : admin/structure/paragraphs_type/imggch et ajouter des champs
-
Créer un champ de type "Entity Reference Revisions field" (nommé ici field_ref_rev_parag, dans "Test", qui a aussi un color picket à 3 valeurs - on epux aussi travailler avec les blocks) : à "Type of item to reference" choisir Paragraphs et "Allowed number of values", "unlimited" ; "Reference method" : Default
Si on ne choisit pas les types à utiliser, tous seront disponibles. ; sauver (le champs) - dans l'affichage du form, choisir le widget Paragraphs pour le champs, et personnaliser
- dans affichage : choisir le format "entitée rendue"
Linking an Paragraph image field to "Content" breaks the content type -> j'ai eu le soucis cf https://www.drupal.org/node/2826834
avec les langues (sites multilingues)
cf https://www.drupal.org/node/2735121
theming des paragraphs
https://www.drupal.org/node/2444893
paragraph.html.twig avec les suggestions :
- paragraph__[view_mode] (ie paragraph--default.html.twig)
- paragraph__[type] (ie paragraph--image.html.twig)
- paragraph__[type]__[view_mode] (ie paragraph--image--default.html.twig)