تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4802 أدوات العرض

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يونيو 16
2812
3
يوليو 15
10472
0
يونيو 15
3728
2
يوليو 22
11603
1
أغسطس 19
3790