I am trying to install the following slider to my own Module https://owlcarousel2.github.io/OwlCarousel2/demos/demos.html.
But unfortunately, Magento has its own complicated mechanism to manage its static assets like js and css.
My question is, "Is it possible to install 3rd party js extension on Magento 2?" if yes then how to make it work?
-
Call the relevant JS scripts in your module so that they load. There is also a pre built Magento 2 module github.com/magespecialist/m2-MSP_OwlCarousel2Anthony– Anthony2019年05月17日 07:18:19 +00:00Commented May 17, 2019 at 7:18
-
Hi yeah, I am currently reading that as well.Yusuf Ibrahim– Yusuf Ibrahim2019年05月17日 07:19:09 +00:00Commented May 17, 2019 at 7:19
-
magento.stackexchange.com/questions/264940/…Prathap Gunasekaran– Prathap Gunasekaran2019年05月17日 08:22:08 +00:00Commented May 17, 2019 at 8:22
-
magento.stackexchange.com/questions/273357/…Prathap Gunasekaran– Prathap Gunasekaran2019年05月17日 08:22:49 +00:00Commented May 17, 2019 at 8:22
1 Answer 1
I advise downloading the JS file from the Owl carousel website and including it in your theme. Steps for that can be found here as Prathap linked.
But if you really want to include external JS you can do so via layout XML:
<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="https://www.google.com/recaptcha/api.js" src_type="url"/>
</head>
</page>
Explore related questions
See similar questions with these tags.