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

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ธ.ค. 19
6352
Website: color of success button แก้ไขแล้ว
1
มี.ค. 15
5924
1
ก.พ. 24
2584
0
ธ.ค. 23
1339
1
ก.ค. 23
3418