2

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?

4

1 Answer 1

2

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.