Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Owl-Carousel Slider - Twig integration?

Solved by George View solution

Started by George 7 years ago · 3 replies · 1933 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 Rene, 1 week ago
2 49 1 week ago
Plugins · by Xavier, 4 weeks ago
2 57 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1184 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 75 2 months ago