Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
10 ตอบกลับ
19088 มุมมอง

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?


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง

Thank You Babu,

How to displays top-menus to my website footer

คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง

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

คำตอบที่ดีที่สุด


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


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง

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

ผู้เขียน

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ต.ค. 21
2896
1
ม.ค. 25
1499
v18 Document layout Problem แก้ไขแล้ว
2
ธ.ค. 24
2407
0
ก.ค. 24
1474
How can i inherit this template? แก้ไขแล้ว
1
ก.ย. 23
2013