summaryrefslogtreecommitdiff
path: root/addons/website/views/website_templates.xml
diff options
context:
space:
mode:
authorCocographique <nmi@odoo.com>2020-07-30 16:15:30 +0000
committerXavier-Do <xdo@odoo.com>2020-08-27 17:07:34 +0000
commit010efaeb6d96f156eced62dfd7d842f1d588698f (patch)
treedeab7b95e17bc185bd1e84aa44ec1eb6798a1ff2 /addons/website/views/website_templates.xml
parentb4866d192e6f4fdfba15b65fa2c209b35b7eb8c0 (diff)
[IMP] website: review brand (logo/text/none) templates
Move it in an external view to be able to place it at a different location depending on the header template. Part of https://github.com/odoo/odoo/pull/56427 task-2264627
Diffstat (limited to 'addons/website/views/website_templates.xml')
-rw-r--r--addons/website/views/website_templates.xml27
1 files changed, 14 insertions, 13 deletions
diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml
index 9ec0821635a..80fc63ced5d 100644
--- a/addons/website/views/website_templates.xml
+++ b/addons/website/views/website_templates.xml
@@ -128,6 +128,9 @@
<!-- Background now controlled by css configuration, using color combinations -->
<attribute name="class" add="o_colored_level o_cc" remove="bg-light" separator=" "/>
</xpath>
+ <xpath expr="//header//a[hasclass('navbar-brand')]" position="replace">
+ <t t-call="website.placeholder_header_brand"/>
+ </xpath>
<xpath expr="//header//div[@id='top_menu_collapse']" position="attributes">
<attribute name="class" separator=" " add="flex-grow-0"/>
</xpath>
@@ -211,12 +214,6 @@
</xpath>
</template>
-<template id="website_name" inherit_id="website.layout" name="Website Name" active="False">
- <xpath expr="//header//a[hasclass('navbar-brand')]" position="replace">
- <a class="navbar-brand" href="/">My Website</a>
- </xpath>
-</template>
-
<template id="brand_promotion" inherit_id="web.brand_promotion" name="Brand Promotion">
<xpath expr="//t[@t-call='web.brand_promotion_message']" position="replace">
<t t-call="web.brand_promotion_message">
@@ -290,17 +287,21 @@
</xpath>
</template>
-<template id="layout_logo_show" inherit_id="website.layout" name="Show Logo">
- <xpath expr="//header//a[hasclass('navbar-brand')]" position="replace">
- <a href="/" class="navbar-brand logo">
- <span t-field="website.logo" t-options="{'widget': 'image'}" role="img" t-att-aria-label="'Logo of %s' % website.name" t-att-title="website.name" />
+<template id="placeholder_header_brand" name="Placeholder Header Brand">
+ <span id="o_fake_navbar_brand"/><!-- Need a fake element so that the menu is still placed correctly -->
+</template>
+
+<template id="option_header_brand_logo" inherit_id="website.placeholder_header_brand" name="Header Brand Logo" active="True">
+ <xpath expr="//*[@id='o_fake_navbar_brand']" position="replace">
+ <a href="/" t-attf-class="navbar-brand logo #{_link_class}">
+ <span t-field="website.logo" t-options="{'widget': 'image'}" role="img" t-att-aria-label="'Logo of %s' % website.name" t-att-title="website.name"/>
</a>
</xpath>
</template>
-<template id="header_logo_none" inherit_id="website.layout" name="No Logo" active="False">
- <xpath expr="//header//a[hasclass('navbar-brand')]" position="replace">
- <a href="/" class="navbar-brand d-none"/>
+<template id="option_header_brand_name" inherit_id="website.placeholder_header_brand" name="Header Brand Name" active="False">
+ <xpath expr="//*[@id='o_fake_navbar_brand']" position="replace">
+ <a href="/" t-attf-class="navbar-brand #{_link_class}">My Website</a>
</xpath>
</template>