I have two fields:

  • Video embed field
  • Image multivalue field

I'm looking for a way to combine both fields into one carousel to display both images and videos.

An example of what I'm looking for can be seen on Steam: https://store.steampowered.com/app/236850/Europa_Universalis_IV/

  • 1
    Custom view mode, provide a twig template, tell the view to output rendered entity and select that view mode. – Kevin Dec 30 '18 at 16:58
  • @khoy, it would be nice if you add more information. What Carousel are you using? What module? Have you already tried something? – sanzante Jan 8 '19 at 10:00
  • The way I use is tossing the variables I need from fields into the required form via a preprocess, and then feeding them to a twig template. – Alexei Rayu Jan 8 '19 at 10:40
  • @sanzante i've just tried slick module and found that i couldn't make it work. – khoy Jan 8 '19 at 13:40

I just started to provide an answer but realized this will result in an opinion-based answer. So I'll just roughly outline some possible procedures.

I'm presuming you have an existing site consisting of some Basic Pages and want to display multimedia slideshows on some of these Basic Pages.

  • Option 1: Create a new Paragraphs Type "Slideshow", containing your video and image fields. Then add a Paragraphs field "Slideshow" to your Basic Pages. Use inline entity forms to let editors create slideshows directly where they will be displayed. Create a custom field formatter you then can choose in the display settings for this Paragraphs field. Build the field formatter to provide the markup you need and to attach your slideshow library.

  • Option 2: Create a new content type "Slideshow" containing your video and image fields. Attach your slideshow library and adjust the markup to your needs. Then use either a new entity reference field in your Basic Pages to reference slideshow nodes and have them displayed as rendered entity. Or add an entity reference field to your Slideshow content type to let editors choose Basic Pages where they want this slideshow to be displayed and then have a Views block restricted to be displayed on all Basic Pages and this Views block has a contextual filter taking the current Basic Page node ID to display the corresponding slideshow(s).

This is a community wiki post. Please feel free to add other options.


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.