Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

detailed web template inheritance for website themes

Subscribe

Get notified when there's activity on this post

This question has been flagged
webinheritancetemplatesthemewebsite_builder
1 Reply
10128 Views
Avatar
Barry Smoke

I tip my hat off to the odoo documenation team.  There is quite a bit of documentation available, however there are some gaps that need filled in, especially for a newbie like me coming from a php background.  The biztech theme available for free helped me the most in figuring out how to modify, and use a basic bootstrap theme.

I have successfully created a theme, and installed it, and I have my homepage rendering to a custom bootstrap theme.  I think I've realized some limitations in the odoo xml theme framework.  I tried to do something simple, in my opinion, which is move the default navigation menu to a location under a parrallax header in the theme.  In php, and traditional cms, this wouldn't be a problem, since there are tags that allow you to place rendered content anywhere inside your theme.  odoo however uses template blocks, and there is not a master template file, that is used on every render(with variables inside for rendering content).

The closest thing is to override the default page layout, using a page definition, but there is not enough documentation of how the default page templates work.  You have to read the code, and there are obviously things I'm missing in the flow. 

I've tried doing a new homepage template using the page=True, and I had much greater control over how that page looked.  The problem with this approach, is the page editing was completely missing.  I could not figure out what t-call to do to include that.

xpath calls are only helpful on the website.layout, and don't help you on an inherited view.

For example, if I were to attempt to replace the existing header in the default layout with empty content, so I could move it later in the template flow, I would think the logical way would be an xpath search with replace.  this works for website.layout, but not if I just want the change on a single page.

<xpath expr="//div[@id='wrapwrap']/header" path is not found, if I use that inside a template, where inherit_id="website.homepage", but it works fine in website.layout.

So my next thought is to actually do this on website.layout, however use template variables to detect homepage.  how would I use a t-call="website.layout", but replace the resulting content based on a t-if homepage?



0
Avatar
Discard
Avatar
S. Edelman
Best Answer

Hello!
I've been struggling with the same matter. I want lighter or even non-existing <header> (navigation mainly) on the front page. I've tried both using xpath like you but indeed do not know how to choose it then only for ONE website page instead of all, and also with using t-extend but no luck so far...

(here the "frontpage" is the view name you can see if you look with "customize theme".

<?xml version="1.0" encoding="utf-8"?>

<templates>

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

<t t-if="website.frontpage">

<t t-jquery="header" t-operation="replace">

<header>

<div class="navbar navbar-default navbar-static-top">

<div class="container">

<div class="collapse navbar-collapse navbar-top-collapse">

<ul class="nav navbar-nav navbar-right" id="top_menu">

<li class="dropdown" t-ignore="true" t-if="website.user_id != user_id" style="display:none;">

<a href="#" class="dropdown-toggle" data-toggle="dropdown">

<b>

<span t-esc="(len(user_id.name)&gt;25) and (user_id.name[:23]+'...') or user_id.name"/>

<span class="caret"></span>

</b>

</a>

<ul class="dropdown-menu js_usermenu" role="menu">

<li id="o_logout"><a t-attf-href="/web/session/logout?redirect=/" role="menuitem">Logout</a></li>

</ul>

</li>

</ul>

</div>

</div>

</div>

</header>

</t>

</t>

</t>

</templates>


0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
how to change tooltip question mark symbol? Solved
web inheritance qweb templates frontend
Avatar
1
Dec 23
2520
How changing the appearance of the Odoo site header template
web templates
Avatar
Avatar
1
Dec 22
6004
How to create option for snippets in website template odoo 15 or 16
web templates
Avatar
Avatar
1
Nov 22
6086
I did not see my newly created theme as tutorial said
theme website_builder
Avatar
0
Sep 21
3994
template inherit by id inherits wrong template
inheritance templates
Avatar
0
Apr 21
2438
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now