Is there a way to render a node with view mode via token? Like:
[node:5:teaser]
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityIs there a way to render a node with view mode via token? Like:
[node:5:teaser]
So the question is how to insert something like [node:5:teaser]
into a formatted text area and get the teaser view of node 5.
This can be done with a combination of modules:
Token Filter is a very simple module to make token values available as an input filter.
So (after adding that filter to the text format), for the current node, we can use e.g. [node:title] in formatted text.
Provides tokens ([entity_type:render:view_mode_name]) that render full entities using view mode specified.
Through AET you can query the DB for entities using Tokens. Examples: [aet:node:1]
In the end you should be able to use [aet:node:5:render:teaser]
in your formatted text.