Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Owl-Carousel Slider - Twig integration?

Solved by George View solution

Started by George 7 years ago · 3 replies · 2407 views
7 years ago

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

thanks,
g

7 years ago

@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):

YAML
process:
    twig: true

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

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

Hope this helps...

last edited 11/22/19 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Plugins · by complanar, 6 days ago
6 265 2 days ago
Plugins · by BenLaKnet, 3 days ago
1 95 3 days ago
Plugins · by complanar, 4 weeks ago
2 415 3 weeks ago
Plugins · by Vladimir Novak, 2 months ago
3 706 2 months ago
Plugins · by Mathieu Lecouturier, 2 months ago
3 545 2 months ago