getgrav / grav-plugin-shortcode-owl-carousel

Grav Shortcode Owl Carousel Plugin
https://getgrav.org
MIT License
11 stars 12 forks source link

Owl Carousel incompatible with some themes #7

Closed finanalyst closed 7 years ago

finanalyst commented 7 years ago

This problem is reported in more detail in the issue about carousel not working with Modular pages. However, I think it is related to the theme, and I suspect with the framework. So I am thinking there is a namespace conflict.

Replicate behaviour: a) create the three image example in the carousel documentation and put in default.md under 01.home/ (together with images) b) place in skeleton with Antimatter, Big Picture & other themes. c) Activate Antimatter, a carousel appears, d) Activate Big Picture, no carousel appears and TypeError reported I tested a few random themes. Themes that do work: Antimatter, Bootstrap, Receptar Themes that do not work: Big Picture, Hydrogen

finanalyst commented 7 years ago

I finally got owl-carosel, the plugin, to work with a customisation of the Big Picture theme. I copied the .css and .js files of the JQuery plugin to the theme and added them as assets. I generated the <div class="owl-carousel"> ... </div> using a twig template. But I cannot work out (or rather don't have any time now) why the html generated by the shortcode, and the html I generated using Grav directly are different. They seem the same to me.
I wonder whether there is a difference arising from the ordering of the loading of the .js files.

One thing different is that in my manual set up I have $(".owl-carousel").owlCarousel() which refers to the class of the div, but in the code generated by the short code, reference is to the id. But I haven't tested whether this is the reason.

chrisjung-dev commented 7 years ago

This has to do with the loading of the jQuery Lib. In Antimatter, this is placed in header, everything is fine when it get's called later.

attilaoroszdev commented 6 years ago

And this issue is closed because...? Will it not be fixed? Is it up to the themes to conform?