将徽标添加到后端顶部导航栏

时间:2019-08-05 10:36:33

标签: css xml odoo qweb odoo-12

我正尝试将徽标添加到顶部导航栏中,如下所示:

enter image description here

我修改了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%/>
</div>

在标头中是这样的:

<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>

但是它破坏了一切。更改后,我只能看到白页。 控制台内部有错误:

enter image description here

怎么了?

1 个答案:

答案 0 :(得分:2)

您的代码可以正常工作,将 height = 100 更改为 height =“ 100” 引号]

enter image description here

您得到的错误是xml.etree.ElementTree.ParseError:格式不正确(无效的令牌):第8行,第102列-,您可以从日志文件中进行检查。

注意:与编辑原始代码相比,始终建议继承。