Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
5 Відповіді
5190 Переглядів

I need to hide footer on one of the websites while using Multi-Website module.

What is the best practice to do so? I saw a flag inside web.frontend_layout that dictates if footer should be rendered. But how do I control this variable depending on a current website? I'm using different domains for different websites.


<footer t-if="not no_footer" id="bottom" data-anchor="true" class="bg-light o_footer">


Using Odoo 13

Аватар
Відмінити
Найкраща відповідь

https://youtu.be/8aNTIxa-qRE

Аватар
Відмінити
Автор

Hey, thank you for the response.

I'm aware of this already, but to me it feels more like a "hack" not a proper solution.

This is standard feature to customise header/footer for multi website

Автор

Also are you sure it is "request.website_id"? For me it says that request does not have property website_id. But something like this is working: website.id == 2

Найкраща відповідь

I'm open to suggestions but I think the best solution would be to add a field to the website module.

from odoo import models, fields

class WebsiteInherited(models.Model)
    _inherit = 'website'
    no_footer = fields.Boolean(string='Website Footer', default=False)


Then create an xpath to the footer

<template id="footer_custom" inherit_id="website.footer_custom" name="Footer">
<xpath expr="//div[@id='footer']" position="attributes">
<attribute name="t-if">not request.website_id.no_footer</attribute>
</xpath>
</template>

Untested but I assume something like that.


Edit:

I forgot to mention you'll have to add the no_footer to the website view so you'll be able to change the value

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
вер. 20
3290
0
лют. 24
1154
2
вер. 22
6559
0
бер. 22
1810
1
лист. 22
2261