Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5132 Vizualizări

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 ?

Imagine profil
Abandonează
Autor

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

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
iun. 16
3112
3
iul. 15
11017
0
iun. 15
3985
2
iul. 22
12445
1
aug. 19
4379