=====
Pages
=====
In this chapter, you will learn how to declare static pages.
Default pages
=============
In Odoo, websites come with a few default static pages (Home, Contact us, 404, ...). They are built
the following way.
.. code-block:: xml
Define the meta title.
.. code-block:: xml
Define the meta description.
.. code-block:: xml
Add a CSS class to the page.
.. code-block:: xml
Hide the header.
.. code-block:: xml
Hide the footer.
.. code-block:: xml
If needed, deactivate default pages.
.. code-block:: xml
:caption: ``/website_airproof/data/pages/home.xml``
.. code-block:: xml
:caption: ``/website_airproof/data/pages/contactus.xml``
Alternatively, replace the default content of these pages using XPath.
.. code-block:: xml
:caption: ``/website_airproof/data/pages/404.xml``
.. seealso::
- `Odoo eLearning: Search Engine Optimization (SEO)
`_
- :doc:`Odoo Documentation on SEO <../../../applications/websites/website/pages/seo>`
Theme pages
===========
You can add as many pages as you want to your website. Instead of defining a ``, create a
page object.
**Declaration**
.. code-block:: xml
:caption: ``/website_airproof/data/pages/about_us.xml``
About us
website_airproof.page_about_us
/about-us
qweb
.. todo:: Missing description in table ...
.. list-table::
:header-rows: 1
:stub-columns: 1
:widths: 20 80
* - Field
- Description
* - name
- Page name.
* - is_published
- Define if the page is published (visible to visitors).
* - key
- View key (must be unique)
* - url
- URL where the page is reachable.
* - type
- View type
* - arch
- View architecture
With `` you use the Odoo default page layout with your code.
.. _header_overlay:
Header overlay
--------------
Make the header background transparent and stand on top of the page content.
.. code-block:: xml
.. image:: pages/header-overlay.png
:alt: Header overlay
Media
=====
Images
------
You can record images in the database and use them later in your design/code. They will also be
available for the end user through the *media dialog*.
.. image:: pages/media-window.png
:alt: Media window
The Website Builder supports the following image file formats: JPG, GIF, PNG, and SVG.
**Declaration**
.. code-block:: xml
:caption: ``/website_airproof/data/images.xml``
About Image 01
ir.ui.view
.. todo:: Missing description in table ...
.. list-table::
:header-rows: 1
:stub-columns: 1
:widths: 20 80
* - Field
- Description
* - name
- Image name
* - datas
- Path to the image file
* - res_model
- Name of the wizard model
Use it as a background image.
.. code-block:: xml
Use it as a regular image.
.. code-block:: xml
Use as a regular image with a color filter.
.. code-block:: xml
.. tip::
The image size greatly influences the user experience, search engine optimization, and overall
website performance. So, be sure to size your images correctly.
Videos
------
Add videos as background.
.. code-block:: xml
.. list-table::
:header-rows: 1
:stub-columns: 1
:widths: 20 80
* - Attribute
- Description
* - data-bg-video-src
- Video URL.
Add videos as content.
.. code-block:: xml
.. list-table::
:header-rows: 1
:stub-columns: 1
:widths: 20 80
* - Attribute
- Description
* - data-oe-expression
- Video URL.
* - src
- Video URL.
Icons
-----
By default, the Font Awesome icons library is included in the Website Builder. You can place icons
anywhere using the CSS Prefix `fa` and the icon's name. Font Awesome is designed to be used with
inline elements. You can use `` tag for brevity, but using a `` is more semantically
correct.
.. code-block:: xml
.. seealso::
`Font Awesome v4 icons `_
Enable the Website Builder style options.
.. code-block:: xml
Increase the icon size (fa-2x, fa-3x, fa-4x, or fa-5x classes).
.. code-block:: xml
.. image:: pages/icon-options.png
:alt: Icon options