Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4443 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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>

Ảnh đại diện
Huỷ bỏ

Still the same error ? or another one ?

Tác giả Câu trả lời hay nhất

@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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 2 24
23943
0
thg 7 18
2567
2
thg 7 18
2958
3
thg 5 23
15457
1
thg 1 23
1860