将徽标添加到后端顶部导航栏 [英] Add logo to the backend top navbar
问题描述
我正在尝试将我的徽标添加到顶部导航栏,如下所示:
我修改了xml文件addons\web\static\src\xml\menu.xml
并添加了这个div:
<div style="height: 100%;display: block;float: left;margin-right: 15px;margin-left: 15px;"><img src="https://www.clubsportive.nl/wp-content/uploads/2018/12/logo-example.jpg" height=100%/>
在标题中像这样:
<nav class="o_main_navbar"><ul class="o_menu_apps"/><div style="height: 100%;display: block;float: left;margin-right: 15px;margin-left: 15px;"><img src="https://www.clubsportive.nl/wp-content/uploads/2018/12/logo-example.jpg" height=100%/>
<a class="o_menu_brand" role="button"/><ul class="o_menu_sections" role="menu"/><ul class="o_menu_systray" role="menu"/></nav></标题>
但它打破了一切.更改后我只看到白页.并且控制台内有错误:
怎么了?
你的代码可以正常工作,将 height=100 更改为 height="100" [使用双引号]
你得到的错误是 xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 8, column 102 -, you can check it from log file.
注意:始终建议继承而不是编辑原始代码.
I'm trying to add my logo to the top navbar like this:
I modified the xml file addons\web\static\src\xml\menu.xml
and added this div:
<div style="height: 100%;display: block;float: left;margin-right: 15px;margin-left: 15px;">
<img src="https://www.clubsportive.nl/wp-content/uploads/2018/12/logo-example.jpg" height=100%/>
</div>
inside the header like this:
<header t-name="Menu" style="background-color: #4c4c4c;">
<nav class="o_main_navbar">
<ul class="o_menu_apps"/>
<div style="height: 100%;display: block;float: left;margin-right: 15px;margin-left: 15px;">
<img src="https://www.clubsportive.nl/wp-content/uploads/2018/12/logo-example.jpg" height=100%/>
</div>
<a class="o_menu_brand" role="button"/>
<ul class="o_menu_sections" role="menu"/>
<ul class="o_menu_systray" role="menu"/>
</nav>
</header>
But it breaks everything. I see only white page after the change. And there are errors inside the console:
What is wrong?
Your code will work fine, change height=100 to height="100" [Use double quotes]
The error you get is xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 8, column 102 -, you can check it from log file.
Note: its always recommended to inherit than editing original code.
这篇关于将徽标添加到后端顶部导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!