This question has been flagged
10 Replies
16953 Views

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?


Avatar
Discard
Best Answer

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

Avatar
Discard

Thank You Babu,

How to displays top-menus to my website footer

Best Answer

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

Avatar
Discard

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

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


Avatar
Discard
Best Answer

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

Avatar
Discard
Author Best Answer

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

Avatar
Discard

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

Author

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