Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
15634 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore
<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
Abbandona
Post correlati Risposte Visualizzazioni Attività
5
feb 24
24140
0
lug 18
2632
4
lug 18
11609
2
lug 18
3026
2
nov 17
4522