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