Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4544 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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>

Awatar
Odrzuć

Still the same error ? or another one ?

Autor Najlepsza odpowiedź

@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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
5
lut 24
24172
0
lip 18
2660
2
lip 18
3066
3
maj 23
15696
1
sty 23
1957