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

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.

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

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!

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 23
3585
5
أغسطس 25
9840
2
يوليو 25
488
2
يوليو 25
968
4
يونيو 25
1099