Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5037 Visualizzazioni

I am new to odoo and would like to know how I could add a slider like the jquery cycle2 into my websites custom theme: I have tried to place the following code:

<template id="myjq" inherit_id="website.assets_frontend" name="Myjq">
<xpath expr="script[last()]" position="after">
<script type="text/javascript" src="/theme_vish/static/src/js/jquery.cycle2.min.js" />
</xpath>
</template>

into my assets.xml but to no avail. What am I doing wrong here ?

Avatar
Abbandona
Autore

Yenthe I have amended the xpath. Sorry what would it be for this specific example id have to add in the dependencies?

Risposta migliore

Hi Vashial,


Your xpath is incorrect so your custom JS is not added to the website. The fix:

<template id="myjq" inherit_id="website.assets_frontend" name="Myjq"> <xpath expr="." position="inside"> <script type="text/javascript" src="/theme_vish/static/src/js/jquery.cycle2.min.js" /> </xpath> </template>

P.S: Don't forget to add your dependencies in the __openerp__.py file.

Yenthe

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
giu 16
3015
3
lug 15
10897
0
giu 15
3910
2
lug 22
12214
1
ago 19
4221