Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5082 มุมมอง

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 ?

อวตาร
ละทิ้ง
ผู้เขียน

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

คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มิ.ย. 16
3047
3
ก.ค. 15
10944
0
มิ.ย. 15
3940
2
ก.ค. 22
12298
1
ส.ค. 19
4289