콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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

아바타
취소
관련 게시물 답글 화면 활동
1
9월 20
3577
0
2월 24
1356
2
9월 22
6900
0
3월 22
2032
1
11월 22
2587