Skip to Content
Menu
This question has been flagged
2 Replies
3500 Views

I need to change the logo size in my website in button print pdf:

<template id="layout_logo_show_my" inherit_id="website.layout" customize_show="True" name="My Show Logo">
    <xpath expr="//header//a[@class='navbar-brand']" position="replace">
        <a href="/" class="navbar-brand logo">
            <img src="/logo.png" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name" style="max-width: 200px; max-height: 150px;/>       

</a>
    </xpath>
    </template>


error=


ParseError: "Error while validating constraint

Element '<xpath expr="//header//a[@class='navbar-brand']">' cannot be located in parent view

Error context:
View `Show Logo`
[view_id: 790, xml_id: website.layout_logo_show, model: n/a, parent_id: 788]


can help me?

Avatar
Discard
Best Answer

Try to inherit from website.layout_logo_show :

<template id="company_logo_show" inherit_id="website.layout_logo_show" customize_show="True" name="Show Logo">
<xpath expr="//a[contains(@class, 'navbar-brand')]" position="replace">
<a class="navbar-brand page-scroll logo" href="#page-top">
<img src="/mf_theme/static/src/img/...."/>
</a>
</xpath>
</template>

Avatar
Discard

Still the same error ? or another one ?

Author Best Answer

@mahmoud:

<template id="layout_logo_show_my" inherit_id="website.layout_logo_show" customize_show="True" name="Show Logo">
        <xpath expr="//a[contains(@class, 'navbar-brand')]" position="replace">
            <a class="navbar-brand page-scroll logo" href="#page-top">
                <img src="/static/src/img/lg.png"/>
            </a>
        </xpath>
    </template>


its doesn't work to me? not error but for logo doesn't show in my website

Avatar
Discard
Related Posts Replies Views Activity
5
Feb 24
22101
0
Jul 18
1763
2
Jul 18
2142
3
May 23
13694
1
Jan 23
1118