Ir al contenido
Menú
Se marcó esta pregunta
10 Respuestas
18856 Vistas

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
Descartar
Mejor respuesta

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

Avatar
Descartar

Thank You Babu,

How to displays top-menus to my website footer

Mejor respuesta

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

Avatar
Descartar

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

Mejor respuesta


<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
Descartar
Mejor respuesta

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

Avatar
Descartar
Autor Mejor respuesta

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

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

Autor

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

Publicaciones relacionadas Respuestas Vistas Actividad
1
oct 21
2773
1
ene 25
1281
2
dic 24
2131
0
jul 24
1336
1
sept 23
1886