Skip to content

Commit adac561

Browse files
[IMP] howto/website: update theming page
This commit updates current theming page, by adding updated content. Task-4316619 closes #12577 Signed-off-by: Carlos Valverde (cvs) <[email protected]>
1 parent 4dbfcc9 commit adac561

File tree

6 files changed

+163
-1
lines changed

6 files changed

+163
-1
lines changed

content/developer/howtos/website_themes/theming.rst

+163-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ always required. It usually contains much more information.
158158
(Blogs, Events, eCommerce, ...), you can also add them.
159159
- Odoo version and major number are mandatory. However, patch number is optional. If you want
160160
to specify the required version of Odoo to run your module, you should use a five arguments
161-
structure, using the first two arguments to indicate the Odoo version.
161+
structure, using the first two arguments to indicate your current Odoo version (for
162+
instance, `{BRANCH}`).
162163

163164
.. image:: theming/versioning.png
164165
:alt: Module versioning
@@ -562,6 +563,167 @@ values and *not* the :file:`primary_variables.scss` file.
562563

563564
http://localhost:8069/website/demo/bootstrap
564565

566+
.. _theming/module/bootstrap/fonts:
567+
568+
Font sizes
569+
~~~~~~~~~~
570+
571+
Odoo has CSS font size classes to separate style (font sizes) and semantic (tag and styles in
572+
general). Both logic can be combined to be more flexible.
573+
574+
.. seealso::
575+
`Bootstrap documentation about display headings
576+
<https://getbootstrap.com/docs/5.1/content/typography/#display-headings>`_
577+
578+
.. _theming/module/bootstrap/fonts/text:
579+
580+
Text style
581+
**********
582+
583+
Odoo's Website Builder allows to select a style for your text. Some are just tag related like the
584+
`Header` with no extra CSS class. Other combine tag and style directly applied on them like the
585+
`Header 1 Display`.
586+
587+
.. image:: theming/header.png
588+
:alt: Header styles
589+
:width: 300
590+
591+
.. code-block:: xml
592+
593+
<!-- h1 with display heading sizes -->
594+
<h1 class="display-1">Heading 1 with Display Heading 1 size</h1>
595+
<h1 class="display-2">Heading 1 with Display Heading 2 size</h1>
596+
<h1 class="display-3">Heading 1 with Display Heading 3 size</h1>
597+
<h1 class="display-4">Heading 1 with Display Heading 4 size</h1>
598+
599+
<!-- Lead text - named "Light" in the dropdown -->
600+
<p class="lead">A text typically used as an introduction.</p>
601+
602+
<!-- Small text -->
603+
<p class="o_small">Body text with a smaller size.</p>
604+
605+
.. _theming/module/bootstrap/fonts/sizing:
606+
607+
Sizing classes
608+
**************
609+
610+
The sizing classes are added on a freshly created `span` tag inside the targeted element (See
611+
examples below).
612+
613+
.. image:: theming/sizing.png
614+
:alt: Sizing classes
615+
:width: 300
616+
617+
.. _theming/module/bootstrap/fonts/sizing/headings-and-body:
618+
619+
Heading and body text
620+
^^^^^^^^^^^^^^^^^^^^^
621+
622+
Assuming these classes can be applied on any text element, take `h2` as an example below:
623+
624+
.. code-block:: xml
625+
626+
<!-- h2 sized like an h1 -->
627+
<h2><span class="h1-fs">Heading</span></h2>
628+
629+
<!-- h2 sized with other heading sizes -->
630+
<h2><span class="h2-fs">Heading</span></h2>
631+
<h2><span class="h3-fs">Heading</span></h2>
632+
<h2><span class="h4-fs">Heading</span></h2>
633+
<h2><span class="h5-fs">Heading</span></h2>
634+
<h2><span class="h6-fs">Heading</span></h2>
635+
636+
<!-- h2 sized like a normal paragraph (base size, 16px by default) -->
637+
<h2><span class="base-fs">Heading</span></h2>
638+
639+
<!-- h2 sized like a small text (14px by default) -->
640+
<h2><span class="o_small-fs">Heading</span></h2>
641+
642+
.. _theming/module/bootstrap/fonts/sizing/display:
643+
644+
Display headings
645+
^^^^^^^^^^^^^^^^
646+
647+
If larger titles are needed, Odoo uses Bootstrap's Display Headings classes, from `display-1` to `6`.
648+
649+
.. code-block:: xml
650+
651+
<h2><span class="display-1-fs">Heading</span></h2>
652+
<h2><span class="display-2-fs">Heading</span></h2>
653+
<h2><span class="display-3-fs">Heading</span></h2>
654+
<h2><span class="display-4-fs">Heading</span></h2>
655+
656+
.. note::
657+
The Website Builder allows the user to configure only sizes from `Display 1` to `Display 4`. You
658+
can set the other sizes (`5` and `6`) to use them in your code but the user won't be able to
659+
modify them directly within the Website Builder interface.
660+
661+
.. _theming/module/website:
662+
663+
Website settings
664+
----------------
665+
666+
Global options related to the website can be set through the website record by following the
667+
structure below.
668+
669+
**Declaration**
670+
671+
.. code-block:: xml
672+
:caption: ``/website_airproof/data/website.xml``
673+
674+
<?xml version="1.0" encoding="utf-8"?>
675+
<odoo noupdate="1">
676+
<record id="website.default_website" model="website">
677+
<field name="name">Airproof</field>
678+
<field name="logo" type="base64" file="website_airproof/static/src/img/content/logo_pred.png"/>
679+
<field name="favicon" type="base64" file="website_airproof/static/description/favicon.png" />
680+
<field name="shop_ppg">18</field>
681+
<field name="shop_ppr">3</field>
682+
<field name="cookies_bar" eval="True" />
683+
<field name="contact_us_button_url">/contact-us</field>
684+
<field name="social_facebook">https://www.facebook.com/Airproof</field>
685+
<field name="social_instagram">https://www.instagram.com/airproof</field>
686+
<field name="social_linkedin">https://www.linkedin.com/company/airproof</field>
687+
<field name="social_youtube">https://www.youtube.com/c/airproof</field>
688+
</record>
689+
</odoo>
690+
691+
.. list-table::
692+
:header-rows: 1
693+
:stub-columns: 1
694+
:widths: 20 80
695+
696+
* - Field
697+
- Description
698+
* - name
699+
- Name of the website (displayed in the browser)
700+
* - logo
701+
- Path to the logo (previously created into a record)
702+
* - favicon
703+
- Path to the favicon (previously created into a record)
704+
* - shop_ppg
705+
- Number of products shown per page in the e-commerce
706+
* - shop_ppr
707+
- Number of products shown per rows (in a page) in the e-commerce
708+
* - cookies_bar
709+
- Enable/disable the cookies bar
710+
* - contact_us_button_url
711+
- URL of the `Contact us` page (For instance, used in the standard header templates).
712+
* - social_facebook
713+
- URL of a Facebook profile
714+
* - social_instagram
715+
- URL of a Instagram profile
716+
* - social_linkedin
717+
- URL of a LinkedIn company profile
718+
* - social_youtube
719+
- URL of a YouTube channel
720+
721+
.. note::
722+
723+
`website.default_website` is the default reference whenever you work with only one website. If
724+
there are several websites in your database, this record will refer to the default site (the
725+
first one).
726+
565727
.. _theming/module/views:
566728

567729
Views
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)