I have a paragraph (I'm using the Paragraphs module) that contains an entity reference field that contains references to other pages.
The display settings are set to use a particular view mode, e.g. teaser
. This renders an teaser image, title and link to the page.
I would like the editor to be able to set the view mode on a per-paragraph basis. I have created a "view mode" field in the paragraph with two options: teaser
, and teaser-text-only
.
How can I use the view mode set in the "parent" entity (the paragraph) to add a template suggestion when rendering the "child" entities (the pages)?