Add logo to the backend top navbar

早过忘川 提交于 2021-01-28 18:44:09

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/57356853/add-logo-to-the-backend-top-navbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!