1

I have two seperate node types and d8 with media installed

in both node types there is a field called video using video_embed_field on a deeper layer in the theme because it uses media entity.

I try to find out how to alte the content of

video-embed-iframe.html per node type.

I am new to d8 and twig.

How can i td this inisde a theme without the need of a custom module

cold i theme the video field per contetn type and then display all template contetn in video field based on an if condition?

0

Twig naming pattern for the field per content type is

field--field-name--content-type.html.twig

Read more on Twig naming convention here.


update

Media entity seems to be following custom template suggestions, that unfortunately are not documented anywhere. See function media_entity_theme_suggestions_media() here for template suggestions patterns. It does not include per content type template suggestion, but you can try overriding it in a custom module.

  • This doesn't work for Media enteties it Works for Fields in General but not in this case – Josh Dec 10 '16 at 20:43
  • See update @Josh – oksana-c Dec 10 '16 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.