不同頁面¶
Odoo allows you to create pages for your website and customize their content and appearance to your needs.
Static pages, such as the homepage or any custom-created,
contain fixed content that does not change dynamically. You can manually create these pages, define
their URLs, and adapt their properties as needed. Dynamic
pages, on the other hand, are generated dynamically. All pages generated automatically by Odoo, for
example, when 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.
页面创建¶
网站页面可以从**前台**和**后台**创建。创建新网站页面的步骤如下:
Either open the Website app, click + New in the top-right corner, then select Page;
Or go to New.
and clickIn the New Page selection menu, click on a template. They are sorted by type:
Basic: Multi-purpose page. A blank page is also available to start from scratch.
About: Information about your brand.
Landing Pages: Summary of company content and info.
Gallery: Photos and media showcase.
Services: Focus on what you’re selling and contact.
Pricing Plans: Highlight on subscription and prices.
团队:您公司背后的团队。
自定义:选择自定义模板。要在此类别中添加模板,请打开要保存为模板的页面,然后转到 ,输入 页面标题, 编辑页面属性,启用 是模板,然后点击 保存。
输入 页面标题 ;该标题将用于菜单和页面的 URL。
按一下 建立。
If needed, customize the page’s content and appearance using the website editor, then click Save.
:ref:`发布 <website/pages/un-publish-page>`页面。
小訣竅
如果页面不应出现在菜单中,则禁用 添加到菜单。
页面管理¶
发布/取消发布页面¶
页面需要发布才能让网站访客看到。要发布或取消发布页面,请访问该页面并切换右上角的开关,从 未发布 切换到 已发布,反之亦然。

備註
也有可能:
从 :ref:`页面属性 <website/pages/page_properties>`中发布/取消发布页面,您可以在其中定义发布日期和/或根据需要限制页面的可见性;
同时发布/取消发布多个页面:进入 操作 并选择 发布`或 :guilabel:`未发布。
,选择页面,然后点击
或者,您可以通过 静态页面 定义为您的主页。选择 发布 选项卡并启用 用作主页。
将任何页面属性¶
要修改 静态页面的 属性,请访问要修改的页面,然后转到 ,在这里可以修改以下属性:
页面 URL:在字段中修改页面 URL。在这种情况下,您可以根据需要将旧 URL 重定向到新 URL。为此,请启用 重定向旧 URL,然后选择 重定向 的 类型:
301 Moved permanently: to redirect the page permanently.
302 临时移动:临时重定向页面。
![]()
In Menu: Disable if you don’t want the page to appear in the menu.
Is Homepage: Enable if you want the page to be the homepage of your website.
已发布:启用发布页面。
发布日期:要在特定日期和时间发布页面,请点击该字段,设置日期和时间,然后按 回车 或点击 应用 以验证您的选择。
索引:如果不希望页面出现在搜索引擎结果中,请禁用。
可见性:选择谁可以访问页面:
公开:每个人都可以访问该页面。
已登录:只有已登录的用户才能访问该页面。
限制组:在 授权组 字段中选择 用户访问组 。
With Password:在 密码 字段中输入访问页面所需的密码。
是模板:切换开关以将页面保存为模板并添加到 定制 类别。
小訣竅
这些属性中的*部分*也可以通过
批量修改。复制页面¶
To duplicate a page, access the page, then go to Duplicate Page. Enter a Page Name, then click OK. By default, the new page is added after the duplicated page in the menu, but you can remove it from the menu or change its position using the menu editor.
, and click删除网页¶
删除页面的步骤如下:
URL 重定向映射¶
URL redirect mapping consists in sending visitors and search engines to a URL different from the one they initially requested. This technique is used, for example, to prevent broken links when you delete a page, modify its URL, or migrate your site from another platform to an Odoo domain. It can also be used to improve Search Engine Optimization (SEO).
要访问现有的 URL 重定向并创建新的 URL 重定向,请 激活开发者模式 并转到 。
要创建新的重定向,请点击 新建 按钮,然后填写字段:
名称:输入名称以标识重定向。
操作:选择重定向类型:
URL 来自:输入要重定向的 URL(例如,
/about-the-company
)或搜索所需的 动态页面 并从列表中选择。转向网址: 对于 301、302 和 308 重定向,请输入目标网址。若需跳转到外部链接,必须包含协议前缀(例如,
https://
)。网站:选择特定网站。
顺序:用于定义重定向的执行顺序,例如重定向链(即一系列重定向,其中一个 URL 被重定向到另一个 URL,而另一个 URL 又被重定向到另一个 URL)。
切换 激活 开关以停用重定向。
重要
404, 301, and 302 redirections are meant to migrate traffic from unpublished or deleted pages to new pages, while the 308 redirect is used for permanent redirections of existing pages.