Hi
I would like to be able to get a node as a shortcode with view mode option
exemple:
I would to display the node 1 with the teaser view mode inside another node
[node nid=1 view=teaser]
Is it possible to do that ?
Hi
I would like to be able to get a node as a shortcode with view mode option
exemple:
I would to display the node 1 with the teaser view mode inside another node
[node nid=1 view=teaser]
Is it possible to do that ?
Comments
Comment #1
denes.szabo commentedHi, yes this feature can be doable. But, you have to consider, the nodes with input filters are cacheable. So, the embedded node content will not refresh automatically when you alter the related (nid=1 in your example) content only just after a cache clear (cache_filter).
So, I would recommend you another solution, maybe entity_reference to the related, embedded content.
Comment #2
creatile commentedThank you for your answer
I have already tried entity_reference but I can't change the order of nodes to display
I found the solution with node_embed project
Best regards
Comment #3
denes.szabo commentedI checked the node_embed module a little bit: I will implement the embed shortcode based on this module.
Comment #4
creatile commentedThat's a good news
The idea is to create content types for :
- pdf
- video
- external link
and to make different view modes for all of them
so it will be possible to embed these nodes easily
Comment #5
peter törnstrand commentedWhile you're at this I would love to see this feature extended to views and blocks. It would also be cool if you could specify the display mode to use for embedding.
For example:
[embed:node/1:teaser][embed:block/delta][embed:view/name:display_name]For views you could even supply arguments:
[embed:view/name:display_name,arg1,arg2,arg3]Comment #6
denes.szabo commentedThe embed_content macro currently works for nodes but not with full view mode…
I need to develop embed entity macro for embedding other type content.
Comment #7
gmclelland commentedFYI.. there's also https://drupal.org/project/token_insert. See it in action at https://drupal.psu.edu/content/token-insert-entity-field-formatters-and-...
Edit: Forgot to mention https://drupal.org/project/token_insert_entity
Comment #8
denes.szabo commented