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

Hi, 

A few people have asked how to get your own CSS / JS file inserted into the website or eCommerce without having to create a module.

I found that an easy way was to go to Technical - Interface - Views and create a new view (type QWeb) which inherits the existing view "Website Assets". Then simply add the following code to it:

```
<?xml version="1.0"?>
<data name="website assets frontend checkd" inherit_id="web.assets_frontend">
      <xpath expr="." position="inside">
           <link rel="stylesheet" href="/path/to/your/file/even/ext/link"/>
           <!-- <script type="text/javascript" src="/path/to/your/js"/> -->
      </xpath>
</data>

```

Could someone comment on whether:
a) this is the 'recommended' way to do it
b) any pro's or con's to doing this? (e.g. will it survive future updates?)

Thanks
Frank

الصورة الرمزية
إهمال
أفضل إجابة

It's the way to do.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
ديسمبر 19
6500
1
مارس 15
6045
1
فبراير 24
2674
0
ديسمبر 23
1431
1
يوليو 23
3506