หน้า

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.

การสร้างหน้า

Website pages can be created from the frontend and the backend. To create a new website page, proceed as follows:

    • Either open the Website app, click + New in the top-right corner, then select Page;

    • หรือไปที่ เว็บไซต์ ‣ ไซต์ ‣ หน้า และคลิก ใหม่

  1. In the New Page selection menu, click on a template. They are sorted by type:

    • พื้นฐาน: หน้าที่ใช้ได้หลายวัตถุประสงค์ มีหน้าว่างให้เริ่มต้นจากศูนย์ด้วย

    • About: Information about your brand.

    • Landing Pages: Summary of company content and info.

    • แกลเลอรี่: การนำเสนอรูปภาพและสื่อ

    • Services: Focus on what you're selling and contact.

    • Pricing Plans: Highlight on subscription and prices.

    • Team: The people behind your company.

    • Custom: To select a custom template. To add a template to this category, open the page you want to save as a template, then go to Site ‣ Properties, enter the Page Title, edit the page's properties, enable Is a template, and click Save.

  2. Enter a Page Title; this title is used in the menu and the page's URL.

  3. คลิก สร้าง

  4. If needed, customize the page's content and appearance using the website editor, then click Save.

  5. เผยแพร่ หน้า

Tip

ปิดใช้งาน เพิ่มไปยังเมนู หากไม่ต้องการให้หน้าปรากฏในเมนู

Page management

การเผยแพร่/ยกเลิกการเผยแพร่หน้า

หน้าจำเป็นต้องถูกเผยแพร่เพื่อให้ผู้เยี่ยมชมเว็บไซต์มองเห็นได้ หากต้องการเผยแพร่หรือยกเลิกการเผยแพร่หน้า ให้เข้าถึงหน้านั้นและสลับสวิตช์ที่มุมบนขวาจาก ยังไม่เผยแพร่ เป็น เผยแพร่แล้ว หรือในทางกลับกัน

สลับยังไม่เผยแพร่/เผยแพร่แล้ว

Note

นอกจากนี้ยังสามารถ:

  • Publish/unpublish a page from the page properties, where you can define a publishing date and/or restrict the page's visibility if needed;

  • Publish/unpublish several pages at once: go to Website ‣ Site ‣ Pages, select the pages, then click Action and select Publish or Unpublish.

Alternatively, you can define any static page as your homepage by going to Website ‣ Site ‣ Properties. Select the Publish tab and enable Use as Homepage.

คุณสมบัติของหน้า

To modify a static page's properties, access the page you wish to modify, then go to Site ‣ Properties, where you can change the following properties:

  • Page URL : Modify the page URL in the field. In this case, you can redirect the old URL to the new one if needed. To do so, enable Redirect old URL, then select the Type of redirection:

    • 301 Moved permanently: เพื่อเปลี่ยนเส้นทางหน้าอย่างถาวร

    • 302 Moved temporarily: เพื่อเปลี่ยนเส้นทางหน้าชั่วคราว

    Redirect old URL
  • 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.

  • Published: Enable to publish the page.

  • Publishing Date: To publish the page at a specific date and time, click the field, set the date and time, then press Enter or click Apply to validate your selection.

  • Indexed: Disable if you don't want the page to appear in search engine results.

  • การมองเห็น: เลือกว่าใครสามารถเข้าถึงหน้าได้:

    • สาธารณะ: ทุกคนสามารถเข้าถึงหน้าได้

    • ลงชื่อเข้าใช้แล้ว: เฉพาะผู้ใช้ที่ลงชื่อเข้าใช้เท่านั้นที่สามารถเข้าถึงหน้าได้

    • Restricted Group: Select the user access group(s) in the Authorized group field.

    • ใช้รหัสผ่าน: พิมพ์รหัสผ่านที่ต้องใช้ในการเข้าถึงหน้าในช่อง รหัสผ่าน

  • Is a template: Toggle the switch to save the page as a template and add it to the Custom category.

Tip

Some of these properties can also be modified in batch from Website ‣ Site ‣ Pages.

การทำซ้ำหน้า

To duplicate a page, access the page, then go to Site ‣ Properties, and click 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.

การลบหน้า

หากต้องการลบหน้า ให้ดำเนินการดังนี้:

  1. Access the page, then go to Site ‣ Properties and click Delete Page.

  2. A pop-up window shows all links referring to the page you want to delete, organized by category. To ensure website visitors don't land on an error page, you must update all the links on your website referring to the page. To do so, expand a category, then click on a link to open it in a new window. Alternatively, you can set up a redirection for the deleted page.

  3. Once you have updated the links (or set up a redirection), tick the I am sure about this check box, then click OK.

การแมปการเปลี่ยนเส้นทาง 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 การเพิ่มประสิทธิภาพเครื่องมือค้นหา (SEO).

To access existing URL redirections and create new ones, activate the developer mode and go to Website ‣ Configuration ‣ Redirects.

Note

  • ระเบียนการเปลี่ยนเส้นทางจะถูกเพิ่มโดยอัตโนมัติทุกครั้งที่คุณ:ref:แก้ไข URL ของหน้า <website/pages/page_properties>`และเปิดใช้งาน:guilabel:`เปลี่ยนเส้นทาง URL เดิม

  • You can set up redirections for static and dynamic pages.

To create a new redirection, click the New button, then fill in the fields:

  • ชื่อ: ป้อนชื่อเพื่อระบุการเปลี่ยนเส้นทาง

  • การดำเนินการ: เลือกประเภทของการเปลี่ยนเส้นทาง:

    • 404 Not found: visitors are redirected to a 404 error page when they try to access an unpublished or deleted page.

    • 301 Moved Permanently: for permanent redirections of unpublished or deleted static pages. The new URL is shown in search engine results, and the redirect is cached by browsers.

    • 302 Moved Temporarily: for short-term redirections, for example, if you are redesigning or updating a page. The new URL is neither cached by browsers nor shown in search engine results.

    • 308 Redirect/Rewrite: for permanent redirections of existing dynamic pages. The URL is renamed; the new name is shown in search engine results and is cached by browsers. Use this redirect type to rename a dynamic page, for example, if you wish to rename /shop into /market.

  • URL จาก: ป้อน URL ที่จะเปลี่ยนเส้นทาง (เช่น /about-the-company) หรือค้นหา:ref:`หน้าแบบไดนามิก <website/pages/page_type>`ที่ต้องการและเลือกจากรายการ

  • URL ไปยัง: สำหรับการเปลี่ยนเส้นทาง 301, 302 และ 308 ป้อน URL ที่จะเปลี่ยนเส้นทางไปยัง หากคุณต้องการเปลี่ยนเส้นทางไปยัง URL ภายนอก ให้รวมโปรโตคอล (เช่น https://)

  • เว็บไซต์: เลือกเว็บไซต์เฉพาะ

  • ลำดับ: เพื่อกำหนดลำดับในการดำเนินการเปลี่ยนเส้นทาง เช่น ในกรณีของลูกโซ่การเปลี่ยนเส้นทาง (คือชุดของการเปลี่ยนเส้นทางที่ URL หนึ่งถูกเปลี่ยนเส้นทางไปยังอีก URL หนึ่ง ซึ่งถูกเปลี่ยนเส้นทางต่อไปยัง URL อื่นอีก)

Toggle the Activate switch to deactivate the redirection.

Important

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.