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

Hi all!
I try to extend footer in website.layout template in my module:

[template.xml]

<template id="layout_footer_counters" inherit_id="website.layout" name="Counters">

    <xpath expr="//div[contains(@id, 'footer')]" position="inside">

        <div class="container">

            <t t-foreach="website.get_all_counters() or []" t-as="counter">

                 <div> <t t-raw="counter.counter"/> </div>

            </t>

        </div>

    </xpath>

</template>


But this block not displayed. If i extend header all work fine:

<template id="assets_frontend" inherit_id="website.assets_frontend" name="Shop">

    <xpath expr="." position="inside">  

        <script type="text/javascript" src="/pr_webcounter/static/src/js/statisctics.js"></script>

    </xpath>

</template>


What is wrong? Where is my mistake?


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

You inherit the the template website.footer_default instead of website.layout.

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

Thank You Babu,

How to displays top-menus to my website footer

Câu trả lời hay nhất

For anyone searching for this in Odoo 13 one must inherit website.footer_custom

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

This answer is correct. I was working in Odoo 14 and I inherited website.footer_custom, it worked great.
Thank you for this answer.

Câu trả lời hay nhất


<template id="new_footer" inherit_id="website.layout">
<xpath expr="//footer" position="replace">
<footer>
<div class="mynewdiv">
<div id="footer_container">
code
</div>
</div>
</footer>
</xpath>
</template>


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

My answer would have been the same as that of Shameem's.

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

>You inherit the the template website.footer_default instead of website.layout.

Why is this happening? In website module template website.layout contains div with id="footer"

<template id="layout" name="Main layout">&lt;!DOCTYPE html&gt;

    <html t-att-lang="lang and lang.replace('_', '-')"

    ...

        t-att-data-oe-company-name="res_company.name">

        <head> </head>

        <body>

            <div id="wrapwrap">

                <header>... </header>

                <main>... </main>

                <footer>

                    <div id="footer"> </div>

                </footer>

            </div>

        </body>

    </html>

</template>


I called website.layout not website.footer_default . 

How can I call website.layout template if string

<template id="layout_footer_counters" inherit_id="website.layout" name="Counters">

is wrong?

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

In website module template website.layout contains div with id="footer".

But

It is replaced by "website.footer_default". It has another div with id="footer".

Tác giả

Thank you for the clarification. Now I see the load of this template.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 21
2875
1
thg 1 25
1406
2
thg 12 24
2284
0
thg 7 24
1431
1
thg 9 23
1971