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

Which Module to inherit the Website Homepage, and how to add the custom html code in website homepage...

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
<odoo>
<template id="theme_custom.new_homepage" inherit_id="website.homepage">
<xpath expr="//div[@id='wrap']" position="replace">
<div id="wrap" class="oe_structure">
              hello
</div>
</xpath>
</template>
</odoo>

Try this
Though Answer From Cybrosys Also works
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

You can extend the website homepage like this,

<template id="new_homepage" inherit_id="website.homepage">
</template>

In Python,


from odoo import http
from odoo.addons.website.controllers.main import Website

class Website(Website):

@http.route(auth='public')
def index(self, data={}, **kw):
super(Website, self).index(**kw)
return http.request.render('<template_external_id>', data)


Please see this link: https://www.odoo.com/forum/help-1/question/odoo-v11-website-how-to-replace-home-page-139437


Thanks

อวตาร
ละทิ้ง
ผู้เขียน

Hi,

Your answer is Odoo V11, but i need Odoo V12.

Your Code is working on Odoo V10 & V11,

But Odoo 12 is not accept it.

How to inherit the website homepage in odoo12.

Thanks & Regards by Mohan

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ย. 24
1066
5
พ.ค. 19
8294
2
ก.ค. 25
6342
1
ก.ค. 25
894
2
มิ.ย. 25
2448