This question has been flagged
3 Replies
12365 Views

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)

Avatar
Discard
Best Answer

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.


Avatar
Discard
Best Answer

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.


Avatar
Discard
Best Answer
<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

Avatar
Discard