hello
I wanted to change the appearance of the default site header in the website template.
But when I put the Odoo code in an xml page by changing the ID, I get the following error:
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
ValueError: Element '' cannot be located in parent view
Template: 776
Path: /t/t
Node:
Part of the code I ran:
xml version="1.0" encoding="utf-8"?>
id="My_template_header" inherit_id="website.layout" name="My Template Header Default" active="True">
expr="//header//nav" position="replace">
t-call="website.navbar">
t-set="_navbar_classes" t-valuef="shadow-sm"/>
id="top_menu_container" class="container justify-content-start justify-content-lg-between">
t-call="website.placeholder_header_brand">
t-set="_link_class" t-valuef="me-4"/>
Please guide me so that I can change the appearance of header through Odoo template.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hello, @mohammad hosein saeedian
Hope you are doing well,
For you to solve the issue of navbar you will need to do the following changes.
- First of all, you need to inherit website navbar template.
- After that you can inherit website header and call navbar template.
Please find code in comment.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Here is a reference code:
<template id="custom_navbar" name="Navbar" inherit_id="website.navbar">
<xpath expr="//nav" position="replace">
<nav class="custom_navbar">
<ul>
<li>DEMO1
</li>
<li>DEMO2
</li>
</ul>
</nav>
</xpath>
</template>
<template id="My_template_header" inherit_id="website.layout" name="My Template Header Default" active="True">
<xpath expr="//header" position="replace">
<t t-call="website.navbar"/>
</xpath>
</template>
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 11 22
|
5012 | ||
|
2
thg 7 25
|
1304 | ||
|
1
thg 5 25
|
823 | ||
|
2
thg 5 25
|
1431 | ||
|
0
thg 7 24
|
1388 |