Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
15536 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai
<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
Buang
Post Terkait Replies Tampilan Aktivitas
5
Feb 24
24019
0
Jul 18
2593
4
Jul 18
11555
2
Jul 18
3001
2
Nov 17
4488