[IMP] Website: pages doc to be updated

taskid-3667291

closes odoo/documentation#9117

Signed-off-by: Audrey Vandromme (auva) <auva@odoo.com>
This commit is contained in:
Donatienne (dopi) 2024-05-02 10:32:28 +02:00
parent 5a78b0fd73
commit a261ffd256

View File

@ -7,12 +7,13 @@ Pages
Odoo allows you to create pages for your website and customize their content and appearance to your Odoo allows you to create pages for your website and customize their content and appearance to your
needs. needs.
.. note:: .. _website/page_type:
*Static* pages are pages that have stable content, such as the homepage. You can manually create
new ones, define their URL, adapt their :ref:`properties <website/page_properties>`, etc. **Static** pages have stable content, such as the homepage. You can manually create new ones, define
*Dynamic* pages, on the other hand, are generated dynamically. All pages generated automatically their URLs, adapt their :ref:`properties <website/page_properties>`, etc. **Dynamic** pages, on the
by Odoo, for example when you install an app or module (e.g., `/shop` or `/blog`) or publish a other hand, are generated dynamically. All pages generated automatically by Odoo, for example, when
new product or blog post, are dynamic pages and are therefore managed differently. you install an app or module (e.g., `/shop` or `/blog`) or publish a new product or blog post, are
dynamic pages and are therefore managed differently.
Page creation Page creation
============= =============
@ -23,7 +24,7 @@ page, proceed as follows:
#. - Either open the **Website** app, click :guilabel:`+ New` in the top-right corner, then select #. - Either open the **Website** app, click :guilabel:`+ New` in the top-right corner, then select
:guilabel:`Page`; :guilabel:`Page`;
- Or go to :menuselection:`Website --> Site --> Pages` and click :guilabel:`New`. - Or go to :menuselection:`Website --> Site --> Pages` and click :guilabel:`New`.
#. Enter a :guilabel:`Page Title`; this title is used in the menu, as well as in the page's URL. #. Enter a :guilabel:`Page Title`; this title is used in the menu and the page's URL.
#. Click :guilabel:`Create`. #. Click :guilabel:`Create`.
#. Customize the page's content and appearance using the website builder, then click #. Customize the page's content and appearance using the website builder, then click
:guilabel:`Save`. :guilabel:`Save`.
@ -41,7 +42,7 @@ Publishing/unpublishing pages
----------------------------- -----------------------------
Pages need to be published to make them accessible to website visitors. To publish or unpublish a Pages need to be published to make them accessible to website visitors. To publish or unpublish a
page, access it, then toggle the switch in the upper-right corner from :guilabel:`Unpublished` page, access it and toggle the switch in the upper-right corner from :guilabel:`Unpublished`
to :guilabel:`Published`, or vice versa. to :guilabel:`Published`, or vice versa.
.. image:: pages/un-published_toggle.png .. image:: pages/un-published_toggle.png
@ -53,27 +54,28 @@ to :guilabel:`Published`, or vice versa.
- publish/unpublish a page from the :ref:`page properties <website/page_properties>`, where you - publish/unpublish a page from the :ref:`page properties <website/page_properties>`, where you
can define a publishing date and/or restrict the page's visibility if needed; can define a publishing date and/or restrict the page's visibility if needed;
- publish/unpublish several pages at once: go to :menuselection:`Website --> Site --> Pages`, - publish/unpublish several pages at once: go to :menuselection:`Website --> Site --> Pages`,
select the pages, then, click :guilabel:`Action` and select :guilabel:`Publish` or select the pages, then click :guilabel:`Action` and select :guilabel:`Publish` or
:guilabel:`Unpublish`. :guilabel:`Unpublish`.
Homepage Homepage
-------- --------
By default, when you create a website, Odoo creates a dedicated :guilabel:`Home` page, but you can When you create a website, Odoo creates a dedicated :guilabel:`Home` page by default, but you can
define any website page as your homepage. To do so, go to :menuselection:`Website --> Configuration define any website page as your homepage. To do so, go to :menuselection:`Website --> Configuration
--> Settings`, then, in the :guilabel:`Website info` section, define the URL of the desired page in --> Settings`, then, in the :guilabel:`Website info` section, define the URL of the desired page in
the field :guilabel:`Homepage URL` (e.g., `/shop`). the field :guilabel:`Homepage URL` (e.g., `/shop`).
Alternatively, you can define any static page as your homepage by going to :menuselection:`Website Alternatively, you can define any :ref:`static page <website/page_type>` as your homepage by going
--> Site --> Properties`. Select the :guilabel:`Publish` tab and enable :guilabel:`Use as Homepage`. to :menuselection:`Website --> Site --> Properties`. Select the :guilabel:`Publish` tab and enable
:guilabel:`Use as Homepage`.
.. _website/page_properties: .. _website/page_properties:
Page properties Page properties
--------------- ---------------
To modify a static page's properties, access the page you wish to modify, then go to To modify a :ref:`static page's <website/page_type>` properties, access the page you wish to modify,
:menuselection:`Site --> Properties`. then go to :menuselection:`Site --> Properties`.
The :guilabel:`Name` tab allows you to: The :guilabel:`Name` tab allows you to:
@ -134,23 +136,23 @@ To delete a page, proceed as follows:
.. _website/URL-redirection: .. _website/URL-redirection:
URL redirects URL redirect mapping
------------- --------------------
Redirecting URLs consists in sending visitors and search engines to a URL that is different from the URL redirect mapping consists in sending visitors and search engines to a URL different from
one they originally requested. This technique is used, for example, to prevent broken links when you the one they initially requested. This technique is used, for example, to prevent broken links when
:ref:`delete a page <website/delete-page>`, :ref:`modify its URL <website/page_properties>`, or move you :ref:`delete a page <website/delete-page>`, :ref:`modify its URL <website/page_properties>`, or
your site to a new :doc:`domain <configuration/domain_names>`. It can also be used to migrate your site from another platform to an Odoo :doc:`domain <configuration/domain_names>`. It
improve :doc:`pages/seo`. can also be used to improve :doc:`pages/seo`.
To access existing URL redirections and create new ones, :doc:`activate the developer mode To access existing URL redirections and create new ones, :doc:`activate the developer mode
</applications/general/developer_mode>` and go to :menuselection:`Website --> Configuration --> </applications/general/developer_mode>` and go to :menuselection:`Website --> Configuration -->
Redirects`. Redirects`.
.. note:: .. note::
- A record is added automatically every time you :ref:`modify a page's URL - A redirect record is added automatically every time you :ref:`modify a page's URL
<website/page_properties>` and enable :guilabel:`Redirect Old URL`. <website/page_properties>` and enable :guilabel:`Redirect Old URL`.
- You can set up redirections for static and dynamic pages. - You can set up redirections for :ref:`static and dynamic pages <website/page_type>`.
To create a new redirection, click the :guilabel:`New` button, then fill in the fields: To create a new redirection, click the :guilabel:`New` button, then fill in the fields:
@ -158,30 +160,33 @@ To create a new redirection, click the :guilabel:`New` button, then fill in the
- :guilabel:`Action`: Select the type of redirection: - :guilabel:`Action`: Select the type of redirection:
- :guilabel:`404 Not found`: visitors are redirected to a 404 error page when they try to access - :guilabel:`404 Not found`: visitors are redirected to a 404 error page when they try to access
the page. an unpublished or deleted page.
- :guilabel:`301 Moved Permanently`: for permanent redirections of static pages; the new URL is - :guilabel:`301 Moved Permanently`: for permanent redirections of unpublished or deleted
shown in search engine results and the redirect is cached by browsers. :ref:`static pages <website/page_type>`. The new URL is shown in search engine results, and the
redirect is cached by browsers.
- :guilabel:`302 Moved Temporarily`: for short-term redirections, for example, if you are - :guilabel:`302 Moved Temporarily`: for short-term redirections, for example, if you are
redesigning or updating the page. The new URL is neither cached by browsers, nor shown in redesigning or updating a page. The new URL is neither cached by browsers nor shown in search
search engine results. engine results.
- :guilabel:`308 Redirect / Rewrite`: for permanent redirections of dynamic pages; the new URL is - :guilabel:`308 Redirect/Rewrite`: for permanent redirections of existing :ref:`dynamic pages
shown in search engine results and the redirect is cached by browsers. Use this redirect type <website/page_type>`. The URL is renamed; the new name is shown in search engine results and is
to rename a dynamic page, for example, if you wish to rename `/shop` into `/market`. cached by browsers. Use this redirect type to rename a dynamic page, for example, if you wish
to rename `/shop` into `/market`.
- :guilabel:`URL from`: Enter the URL to be redirected (e.g., `/about-the-company`) or search for - :guilabel:`URL from`: Enter the URL to be redirected (e.g., `/about-the-company`) or search for
the desired dynamic page and select it from the list. the desired :ref:`dynamic page <website/page_type>` and select it from the list.
- :guilabel:`URL to`: For 301, 302 and 308 redirects, enter the URL to be redirected to. If you want - :guilabel:`URL to`: For 301, 302, and 308 redirects, enter the URL to be redirected to. If you want
to redirect to an external URL, make sure to include the protocol (e.g., `https://`). to redirect to an external URL, include the protocol (e.g., `https://`).
- :guilabel:`Website`: Select a specific website. - :guilabel:`Website`: Select a specific website.
- :guilabel:`Sequence`: to define the order in which redirections are performed, e.g., in the case - :guilabel:`Sequence`: To define the order in which redirections are performed, e.g., in the case
of redirect chains (i.e., a series of redirects where one URL is redirected to another one, which of redirect chains (i.e., a series of redirects where one URL is redirected to another one, which
is itself further redirected to another URL). is itself further redirected to another URL).
Toggle the :guilabel:`Activate` switch to deactivate the redirection. Toggle the :guilabel:`Activate` switch to deactivate the redirection.
.. note:: .. important::
404, 301 and 302 redirections only work if the original page has been :ref:`unpublished 404, 301, and 302 redirections are meant to migrate traffic from
<website/un-publish-page>` or :ref:`deleted <website/delete-page>`. :ref:`unpublished <website/un-publish-page>` or :ref:`deleted <website/delete-page>` pages
to *new* pages, while the 308 redirect is used for *permanent* redirections of *existing* pages.
.. seealso:: .. seealso::
- `Google documentation on redirects and search <https://developers.google.com/search/docs/crawling-indexing/301-redirects>`_ - `Google documentation on redirects and search <https://developers.google.com/search/docs/crawling-indexing/301-redirects>`_