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

Denes.Szabo’s picture

Status: Active » Closed (works as designed)

Hi, 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.

creatile’s picture

Thank 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

Denes.Szabo’s picture

Assigned: Unassigned » Denes.Szabo
Status: Closed (works as designed) » Needs work

I checked the node_embed module a little bit: I will implement the embed shortcode based on this module.

creatile’s picture

That'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

Peter Törnstrand’s picture

While 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]

Denes.Szabo’s picture

The 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.

gmclelland’s picture

Denes.Szabo’s picture

Issue summary: View changes
Status: Needs work » Closed (works as designed)