Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

detailed web template inheritance for website themes

Subscriure's

Get notified when there's activity on this post

This question has been flagged
webinheritancetemplatesthemewebsite_builder
1 Respondre
10138 Vistes
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
Descartar
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
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
how to change tooltip question mark symbol? Solved
web inheritance qweb templates frontend
Avatar
1
de des. 23
2520
How changing the appearance of the Odoo site header template
web templates
Avatar
Avatar
1
de des. 22
6012
How to create option for snippets in website template odoo 15 or 16
web templates
Avatar
Avatar
1
de nov. 22
6089
I did not see my newly created theme as tutorial said
theme website_builder
Avatar
0
de set. 21
3995
template inherit by id inherits wrong template
inheritance templates
Avatar
0
d’abr. 21
2439
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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