Owl-Carousel Slider - Twig integration?

hello all,

I am trying to combine the “modular/text” template of the Quark theme with the owl carousel.
The goal: having a owl slider instead of a static image next to the text.

Found this receipe This is How to get Owl Carousel to Automatically Display all the Images in a Directory, but don’t really get it to work. When i copy the code in the twig file, the owl shortcode is not processed. And when i copy it in the markdown area of the page, the twig is obviously not processed.

As always: any hints are welcome. :slight_smile:


@leG, The ‘Shortcode Owl Carousel’ plugin processes a certain tag/shortcode inside the Markdown page. And your Twig code is not being processed inside Markdown… A catch-22 it seems…

Fortunately, Twig processing inside Markdown can be enabled by setting the following in frontmatter (docs):

    twig: true

Then you can mix Twig inside your markdown page as follows:

title: My Owl carousel
   twig: true
[owl-carousel items=1 nav=true]
   <img src="{{ page.media['image-1.jpg'].url }}">
   <img src="{{ page.media['image-2.jpg'].url }}">

Hope this helps…

hey @pamtbaau
thanks for the hint. using twig in my md file is actually not what i am going for. but i very much like your approach here: Need help to utilize the Owl Carousel shortcode plugin

Please have a brief look at my reply.
In short: “I still can’t get it to work. Please help.” :laughing:

this is the way to do it

thanks @pamtbaau :raised_hands: