Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5648 Lượt xem

Adding a css/js file is easy in a template. Is there a way to remove css files. I am making a user preference that requires adding css if the option is true, but what if I want to remove that css file when the option is false.

This is how to add:

<xpath expr="//html/head/t" position="after">
<link t-if="option == true" href="option.css" rel="stylesheet"/>
</xpath>



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

try:

<xpath expr="//html/head/link[@href='option.css']" position="replace">
</xpath>



Ảnh đại diện
Huỷ bỏ