Here is a patch allowing to :
- Choose the view mode per bundle.
- Choose to print entity or not based on the entity bundle.

Example of use cases (especially interesting with Media Entity, Paragraphs, etc.) :
- Media Entity : allow to print the first video or image or all videos, all images, etc.
- Paragraphs : print all the "text + image" paragraphs, or print only the first Text + image paragraph, etc. Interesting for example to create the teaser mode (in a View, get the first "Image paragraph" and the the begining of the first "Textual paragraph").

Hope it's clear and interesting ;-)

Maybe we could also :
- Add a summary for that.
- Get only the active view modes per bundle.
- Put everything in a collapsed fieldset.

CommentFileSizeAuthor
#2 bundle-handling.patch4.59 KBeme
bundle-handling.patch4.59 KBeme

Comments

eme created an issue. See original summary.

eme’s picture

StatusFileSize
new4.59 KB

Little correction.

s_leu’s picture

Status: Needs review » Needs work

@eme

Thanks for the patch, but as you can read here, it's not compatible with the way a patch for a Drupal patch should look like, see also the discussion here: https://drupal.stackexchange.com/questions/110784/how-make-patch-in-phps...

Please refer to these instructions https://www.drupal.org/node/707484 and re-create it.

Also before i can commit this, your ideas do absolutely make sense, i.e.

- Add a summary for that.
- Get only the active view modes per bundle.
- Put everything in a collapsed fieldset.

So if you could yet add this and create the patch as i suggested above, i'll do a review afterwards.