Drupal 8 Theming - Part 14 - Field Collections

preview_player
Показать описание
In this tutorial of Drupal 8 Theming series we are going to do field collections. That means that we are going to group few fields together and display them in our theme.

For this we are going to use a module called, wait for it... Field Collection. That's right, the module is called by exactly what it does. And what it does is that it gives us a very easy way to make groups of fields that we can display on our node.

Field Collection:

Code used in this video:

Рекомендации по теме
Комментарии
Автор

I am learning twig now in 2023 and thank you 😭🥺❤️‍🔥❤️‍🔥❤️‍🔥❤️‍🔥❤️‍🔥❤️‍🔥

moon..
Автор

Hi i'am italian boy. Your tutorial is very important for me. Tanks

francescoguida
Автор

Very informative videos. you are such a good teacher sir. thanks for uploading good series

MuhammadImranJutt
Автор

Don't know if anyone is still using this series, but paragraphs is probably a better choice than field collection for D8. In the example given it can be used about the same. Paragraphs seems to have a lot more current work being done and there is now a stable release version.

jamesharrison
Автор

Thanks again Ivan. I learned a lot today. But I did not use Field_collections because today they say "Paragraphs is likely to replace field collection for Drupal 8"
So I used Paragraphs and it worked almost identical as Field_collection when I was following your excellent tutorial.

All the best
/Sven-Ivan

svenivan
Автор

Very Helpful. Thank you very much Ivan!!! :)

justyramos
Автор

This is a good way to do this and maybe the best, but I thought it would not hurt to mention two alternative modules that might be as good, Inline Entity Form and Paragraphs

georgemorrison
Автор

ACF Repeater Fields in Drupal, great :)

gfreeman
Автор

Thank you so much for this video :)
you are number One ;)

mohamedfadi
Автор

Ivan the Terrible !! :-)
Thank you so much for this Drupal serie !

jbsness
Автор

Nice tutorial. However, has anyone tried this on a block twig? Rendering the field as a whole like throws an error saying "Exception: Object of type cannot be printed."

PratipGhoshPG
Автор

Great video Ivan. I have a question, how would you create accordions/tabs using the Field Collections module?

bobanmaster
Автор

Thank you for this video. Can you solve this problem that I have been facing? No luck in figuring this out yet.

I have created a foreach loop in my node template in Drupal 8 where values of the field collection are being printed as 1 and 2. Instead I want the content of the field collection which includes an image and two text fields to be printed here. How do I achieve that? My code:

{% for member in %} {{member.value}} {% endfor %}

I have no prior knowledge of preprocess or .theme functions except those features that have been covered in this tutorial.

adhavanjo
Автор

Love your series. Do you save all your template files (.twig) on the root of your theme? if not, how do you reference them?

LumasTV