Skip to content

Commit ce49002

Browse files
toaa-odoo“Audrey
authored andcommitted
[IMP] website: "pages" page
Adding a documentation on "pages" within the already existing "page" toctree task-3383323
1 parent 10e6f02 commit ce49002

File tree

5 files changed

+178
-1
lines changed

5 files changed

+178
-1
lines changed

content/applications/websites/website/pages.rst

Lines changed: 178 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,186 @@
1-
:nosearch:
1+
:show-content:
22

33
=====
44
Pages
55
=====
66

7+
Odoo allows you to create pages for your website and customize their contents and appearance to your
8+
needs.
9+
10+
Page creation
11+
=============
12+
13+
Website pages can be created from the **frontend** and from the **backend**. To create a new website
14+
page, proceed as follows:
15+
16+
#. - Either open the **Website** app, click :guilabel:`+ New` in the top-right corner, then select
17+
:guilabel:`Page`;
18+
- Or go to :menuselection:`Website --> Site --> Pages` and click :guilabel:`New`.
19+
#. Enter a :guilabel:`Page Title`; this title is used in the menu, as well as in the page's URL.
20+
#. Disable :guilabel:`Add to menu` if the page should not appear in the menu.
21+
#. Click :guilabel:`Create`.
22+
#. Customize the page's contents and appearance using the Website Builder, then click
23+
:guilabel:`Save`.
24+
#. :ref:`Publish <website/un-publish-page>` the page.
25+
26+
Page management
27+
===============
28+
29+
.. _website/un-publish-page:
30+
31+
Publishing/unpublishing pages
32+
-----------------------------
33+
34+
Pages need to be published to make them accessible to website visitors. To publish or unpublish a
35+
page, access the page, then toggle the switch in the upper-right corner from :guilabel:`Unpublished`
36+
to :guilabel:`Published`, or vice versa.
37+
38+
.. image:: pages/un-published_toggle.png
39+
:alt: Unpublished/Published toggle
40+
41+
.. tip::
42+
It is also possible to:
43+
44+
- publish/unpublish a page from the :ref:`page properties <website/page_properties>`, where you
45+
can define a publishing date and/or restrict the page's visibility if needed;
46+
- publish/unpublish several pages at once: Go to :menuselection:`Website --> Site --> Pages`,
47+
select the pages, then, click :guilabel:`Action` and select :guilabel:`Publish` or
48+
:guilabel:`Unpublish`.
49+
50+
Homepage
51+
--------
52+
53+
By default, when you create a website, Odoo creates a dedicated **Home** page (`/`), but you can
54+
define any website page as your homepage. To do so, open the desired page, then go to
55+
:menuselection:`Website --> Site --> Properties`. In the :guilabel:`Publish` tab, enable
56+
:guilabel:`Use as Homepage`.
57+
58+
.. note::
59+
Alternatively, you can modify your website's homepage in the website settings. Go to
60+
:menuselection:`Website --> Configuration --> Settings`, then, in the :guilabel:`Website info`
61+
section, define the URL of the desired page in the field :guilabel:`Homepage URL`.
62+
63+
.. _website/page_properties:
64+
65+
Page properties
66+
---------------
67+
68+
To modify a page's properties, access the page you wish to modify, then go to
69+
:menuselection:`Website --> Site --> Properties`.
70+
71+
The :guilabel:`Name` tab allows you to:
72+
73+
- rename the page using the :guilabel:`Page Name` field;
74+
- modify the :guilabel:`Page URL`. In this case, you can :ref:`redirect the old URL to the new one
75+
<website/URL-redirection>` if needed. To do so, enable :guilabel:`Redirect Old URL`, then select
76+
the :guilabel:`Type` of redirection.
77+
78+
.. image:: pages/page-redirection.png
79+
:alt: Redirect old URL
80+
81+
You can further adapt the page's properties in the :guilabel:`Publish`: tab:
82+
83+
- :guilabel:`Show in Top Menu`: Disable if you don't want the page to appear in the menu;
84+
- :guilabel:`Use as Homepage`: Enable if you want the page to be the homepage of your website;
85+
- :guilabel:`Indexed`: Disable if you don't want the page to be indexed, i.e., shown in search
86+
engine results;
87+
- :guilabel:`Published`: Enable to publish the page;
88+
- :guilabel:`Publishing Date`: To publish the page at a specific moment, select the date,
89+
click the clock icon to set the time, then click the green check mark to validate your selection.
90+
- :guilabel:`Visibility`: Select who can access the page:
91+
92+
- :guilabel:`All`
93+
- :guilabel:`Signed In`
94+
- :guilabel:`Restricted Group`: Select the group in the :guilabel:`Authorized group` field.
95+
- :guilabel:`With Password` : Enter the password in the :guilabel:`Password` field.
96+
97+
.. tip::
98+
Alternatively, *some* of these properties can also be modified from :menuselection:`Website -->
99+
Site --> Pages`.
100+
101+
Duplicating pages
102+
~~~~~~~~~~~~~~~~~
103+
104+
To duplicate a page, access the page, then go to :menuselection:`Website --> Site --> Properties`
105+
and click :guilabel:`Duplicate Page`. Enter a :guilabel:`Page Name`, then click :guilabel:`OK`.
106+
By default, the new page is added at the end of the menu, but you can remove it from the menu or
107+
move its position using the menu editor.
108+
109+
.. _website/delete-page:
110+
111+
Deleting pages
112+
~~~~~~~~~~~~~~
113+
114+
To delete a page, proceed as follows:
115+
116+
#. Access the page, then go to :menuselection:`Website --> Site --> Properties` and click
117+
:guilabel:`Delete Page`.
118+
#. A pop-up window appears on the screen with all links referring to the page you want to delete,
119+
organized by category. Expand a category, e.g., :guilabel:`Page`, then click on a link to open
120+
it in a new window.
121+
#. Once you have updated the links (or set up a :ref:`redirection <website/URL-redirection>`),
122+
select the :guilabel:`I am sure about this` check box, then click :guilabel:`OK`.
123+
124+
.. note::
125+
Visitors are redirected to a 404 error page when they try to access a deleted page, either
126+
directly or through a link that hasn't been updated. You can prevent this by defining a
127+
:ref:`redirection <website/URL-redirection>` for the page's URL.
128+
129+
.. _website/URL-redirection:
130+
131+
URL redirects
132+
-------------
133+
134+
Redirecting URLs consists in sending visitors and search engines to a URL that is different from the
135+
one they originally requested. This technique is used, for example, to prevent broken links when you
136+
:ref:`delete a page <website/delete-page>`, :ref:`modify its URL <website/page_properties>`, or move
137+
your site to a new :doc:`domain </administration/maintain/domain_names>`. It can also be used to
138+
improve :doc:`pages/seo`.
139+
140+
To access existing URL redirections for your website and create new ones, :doc:`activate the
141+
developer mode </applications/general/developer_mode>` and go to :menuselection:`Website -->
142+
Configuration --> Redirects`.
143+
144+
.. note::
145+
A record is added automatically everytime you :ref:`modify a page's URL <website/page_properties>`
146+
and enable :guilabel:`Redirect Old URL`.
147+
148+
To create a new redirection, click the :guilabel:`New` button, then fill in the fields:
149+
150+
- :guilabel:`Name`: Enter a name to identify the redirect.
151+
- :guilabel:`Action`: Select the type of redirection:
152+
153+
- :guilabel:`404 Not found`: visitors are redirected to a 404 error page when they try to access
154+
the page.
155+
- :guilabel:`301 Moved Permanently`: for permanent redirections of static pages; the new URL is
156+
shown in search engine results and the redirect is cached by browsers.
157+
- :guilabel:`302 Moved Temporarily`: for short-term redirections, for example, if you are
158+
redesigning or updating the page. The new URL is neither cached by browsers, nor shown in
159+
search engine results.
160+
- :guilabel:`308 Redirect / Rewrite`: for permanent redirections of existing Odoo routes/
161+
controllers. Use this redirect type to rename a controller, for example, if you wish to rename
162+
`/shop` into `/market`.
163+
164+
- :guilabel:`URL from`: Enter the URL to be redirected (e.g., `/about-the-company`) or search for
165+
the desired route/controller and select it from the list.
166+
- :guilabel:`URL to`: For 301, 202 and 308 redirects, enter the URL to be redirected to. If you want
167+
to redirect to an external URL, make sure to include the protocol (e.g., `https://`).
168+
- :guilabel:`Website`: Select a specific website.
169+
- :guilabel:`Sequence`: to define the order in which redirections are performed, e.g. in the case of
170+
redirect chains (i.e., a series of redirects where one URL is redirected to another one, which is
171+
itself further redirected to another URL).
172+
173+
Toggle the :guilabel:`Activate` switch to deactivate the redirection.
174+
175+
.. note::
176+
- 301 and 308 redirections are cached by browsers.
177+
- 404, 301 and 302 redirections only work if the original page has been :ref:`unpublished <website/un-publish-page>`
178+
or :ref:`deleted <website/delete-page>`.
179+
180+
.. seealso::
181+
- `Redirects and Google Search <https://developers.google.com/search/docs/crawling-indexing/301-redirects>`_
182+
- :doc:`pages/seo`
183+
7184
.. toctree::
8185
:titlesonly:
9186

5.91 KB
Loading
9.06 KB
Loading
63 KB
Loading
3.57 KB
Loading

0 commit comments

Comments
 (0)