Skip to content

Commit f7738a4

Browse files
committed
[IMP] website_themes: layout
Add explanation about the `template_header_mobile` closes #12634 X-original-commit: 8c6fb20 Signed-off-by: Brandon Mercier (bram) <[email protected]>
1 parent 3c602e7 commit f7738a4

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

Diff for: content/developer/howtos/website_themes/layout.rst

+34-2
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,24 @@ Image/pattern
364364
Header
365365
======
366366

367-
By default, the header contains a responsive navigation menu and the company's logo. You can easily
368-
add new elements or create your own template.
367+
By default, the header contains two distinct templates (desktop and mobile) which display the main
368+
navigation, the company's logo and other optional elements (call-to-action, language selector, etc).
369+
Depending on the situation, choose between enabling/disabling existing elements with a standard
370+
template or building a brand new custom template.
369371

370372
.. _website_themes/layout/header/standard :
371373

372374
Standard
373375
--------
374376

377+
The Odoo Website Builder distinguishes between desktop templates and the mobile template in order to
378+
facilitate the adaptation of the user experience according to the device.
379+
380+
.. _website_themes/layout/header/standard/desktop :
381+
382+
Desktop template
383+
~~~~~~~~~~~~~~~~
384+
375385
Enable one of the header default templates.
376386

377387
.. important::
@@ -404,6 +414,18 @@ Explicitly set the desired template in the `primary_variables.scss` file.
404414
<field name="active" eval="True"/>
405415
</record>
406416
417+
.. _website_themes/layout/header/standard/mobile :
418+
419+
Mobile template
420+
~~~~~~~~~~~~~~~
421+
422+
Each header template comes with the `template_header_mobile` template ensuring a seamless user
423+
experience accross every devices.
424+
425+
.. seealso::
426+
`Mobile header template on Odoo's Git repository <https://github.com/odoo/odoo/blob/d053ea84d45f2ba50a31c2773f2d3ded9fd1ee6b/addons/website/views/website_templates.xml#L343>`_
427+
428+
407429
.. _website_themes/layout/header/custom :
408430

409431
Custom
@@ -475,6 +497,16 @@ variables.
475497
</field>
476498
</record>
477499
500+
Don't forget to adapt the `template_header_mobile` accordingly to keep consistency between desktop
501+
and mobile:
502+
503+
.. code-block:: xml
504+
:caption: ``website_airproof/views/website_templates.xml``
505+
506+
<template id="template_header_mobile" inherit_id="website.template_header_mobile" name="Airproof - Template Header Mobile">
507+
<!-- Xpaths -->
508+
</template>
509+
478510
.. _website_themes/layout/header/components :
479511

480512
Components

0 commit comments

Comments
 (0)