跳至内容
菜单
此问题已终结
3 回复
15421 查看

I am a complete newbie.

I want to change the default navbar and footer with my own templates. Right now I'm editing the /addons/website/views/website_templates.xml file, but nothing changes. 

I want to edit the following page : http://pho.to/Ain4b (Remove odoo logo and change the contact us, about us information and add some css on hovering the home, contact us etc links)

形象
丢弃
最佳答案

Hello,


If you want to change the navbar and footer you need to find the template respectively and then you can inherit it and replace, then you can change according to your need. In your case, 


for navbar, 




<template id="website_navbar_theme_template" inherit_id="website.template_header_default" name="Template Header Theme" active="True">


<xpath expr="//t[@t-call='website.navbar']" position="replace">


<div id="wrap" class="oe_structure oe_empty">


 """Add your required data here"""


</div>


            </xpath>


</template>




for footer,




<template id="footer_layout_website" name="Main layout" inherit_id="portal.frontend_layout">


<xpath expr="//footer" position="replace">


<footer>


<div class="container-fluid">


"""Add your requirements here"""


</div>


</footer>


</xpath>


</template>




for contact us page,




<template id="website_contactus" inherit_id="website.contactus">


<xpath expr="//t" position="replace">


<t t-call="website.layout">


<div id="wrap" class="oe_structure oe_empty">


<div class="container-fluid ">


<div class="container ">


<div class="row">


 """Add contact us information here"""


</div>


</div>


</div>


</div>


</t>


</xpath>


</template>




Like this, find the template of needed pages and inherit it and replace it. If there is no template, create a new template by calling


 <t t-call="website.layout"> inside the template. and from the controllers return to that page when menu click.


形象
丢弃
最佳答案

Hi Ashish,

You have to create a custom addon that overrides existing templates like "contactus", "aboutus" etc.. Your file  website_templates.xml exactly correct. If you are changing the contents directly, You have to upgrade that module after your editings. Then only it will effect the website template.


形象
丢弃
最佳答案
<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

形象
丢弃
相关帖文 回复 查看 活动
5
2月 24
23900
0
7月 18
2554
4
7月 18
11440
2
7月 18
2936
2
11月 17
4427