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

Hello,


I am using Odoo Online for my website and am looking for which view I need to change the header  code, (HTML/CSS). I find multiple ones but cannot find exactly which one I have to modify.


 I find the website builder too limited for this purpose. Can anyone point me towards the right view ?

Thank you for your help.

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

The sitewide header is made of multiple views. Depending of the template you picked, there are: the logo, title, cta btn, contact btn, submenu btn, languages(selector, flag, and more) and possibly more views. There are so many views that I can't list them all. 

Instead, I can tell you how I search and find them: I inspect the HTML source code of the page I want to edit (since you want the sitewide header, then any page will do), I decide around which html area I wanna edit, I pick words that seem unique and might lead me to the target view (Id name, classes, attributes, tags, etc), then I open the Views (settings > technical > user interface > views) type in the search box the words I picked and select the option "Search view arquitecture for:". This option searchs for all the content of each single view. Literal text (hardcoded) will be found, whereas text that comes from variables won't be found. If I don't find the object I'm looking for, it means it was rendered via some Qweb statement, thus is not hardcoded, then I try searching for the parent object or further up. Once I find the closest matching ancestor, I can see the qweb/python code that generated the child, and edit it.

It took me a while to learn how to find the corresponding views, but with trial and error you develop a sense of understanding of how Odoo is made and it becomes much easier to find them.

Good luck hunting and editing views!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 23
3579
5
thg 8 25
9777
2
thg 7 25
442
2
thg 7 25
944
4
thg 6 25
1063