Skip to Content
Menu
This question has been flagged
2 Replies
7198 Views
I try to make my own header on odoo 9 . for that i try to replace the current header using this :

<template id="new_header" inherit_id="website.layout">
<xpath expr="//header" position="replace">
<div>...</div>
</xpath>

</template>
but an error occurred saying :
Error details:
Element '<xpath expr="//header//a[@class='navbar-brand']">' cannot be located in parent view

Error context:
View `Show Logo`
[view_id: 348, xml_id: website.layout_logo_show, model: n/a, parent_id: 222]
None" while parsing None:50, near
<data inherit_id="website.layout">
<xpath expr="//header" position="replace">
<div>...</div>
</xpath>

</data>
can any body help me to do that. Thanks !
Avatar
Discard
Author Best Answer

I found the solution for me...

There are two templates that inherent from website.layout and change somethings into the header :

1-Show logo

2-Show sign in

So to solve this problem u must either remove these two templates or if u don't want to make change into the website module u can try this :

<template priority="100" id="new_header" inherit_id="website.layout">
    <xpath expr="//header" position="replace">
        <div>customize ur new header...</div>
    </xpath>

</template>

Avatar
Discard
Best Answer

Hi 

is coded in a new module that you create if that's it check the file  __manifest__

'depends': ['website'],
Avatar
Discard