ヘッダーとフッター

The website header is the top section of a web page and typically includes elements such as the logo, navigation menu, search bar, and sign-in or customer account button. The footer is displayed at the bottom of a web page and usually contains contact details, links, legal notices, and other useful information. Both can be customized as needed.

ヘッダーのコンテンツ

The header includes company information, quick-access buttons, and website menus to help users navigate the website effectively. Well-structured, user-friendly headers and menus also play an important role in improving search engine rankings.

メニュー項目を追加

デフォルトでは、ページは:doc:`作成時 <../structure/pages>`にドロップダウンメニュー項目としてメニューに追加されます。新しいメニュー項目を追加するには、次の手順に従います:

  1. In the menu editor, click Add Menu Item.

  2. In the pop-up window, enter the Title to be displayed in the menu.

  3. In the URL or Email field, type / to search for an existing page on the website or # to search for an existing custom anchor.

    注釈

    To add a menu item for a page that does not exist yet, enter the new URL or anchor and click Create Page in the Edit Menu pop-up. If you add the menu item without creating the corresponding page, the link leads to a 404 error page.

  4. :guilabel:`続行`をクリックしてください。

  5. Adjust the menu structure if needed.

  6. 保存 をクリックします。

Hide a dynamic menu item for non-logged-in users

To hide the Shop menu item for non-logged-in users, restrict e-commerce access to logged-in users.

To hide other menu items related to dynamic pages (i.e., a menu item generated automatically by Odoo, for example, when installing an app or module, such as Events, Courses, etc.) to non-logged-in users, follow these steps:

  1. 開発者モードを有効にする

  2. :menuselection:`ウェブサイト --> 設定 --> メニュー`に移動します。

  3. Expand the list of menus for the relevant website if needed.

  4. Select the menu item you wish to hide.

  5. In the Visible Groups section, click Add a line.

  6. Search for the group Name Role / Portal, and Select it.

  7. セーブ。

ちなみに

You can further customize the menu items on this menu item form. For example:

  • Enable the New Window checkbox to open the page in a new tab when clicked.

  • Add a Related Page or Related Model Page.

  • Assign a Parent Menu, and/or Child Menus to create a hierarchy.

メガメニュー

Mega menus are similar to drop-down menus, but instead of displaying a simple list of sub-menus, they show a panel divided into groups of navigation options. They are especially useful for websites with large amounts of content or e-commerce websites, as they can help include all of the web pages or e-commerce categories in the menu while keeping all menu items visible at once.

ナビゲーションバーのメガメニュー。

To create a mega menu, follow these steps:

  1. In the menu editor, click Add Mega Menu Item.

  2. In the pop-up window, enter the Title of the mega menu.

  3. :guilabel:`続行`をクリックしてください。

  4. Adjust the menu structure if needed.

  5. 保存 をクリックします。

Mega menus are built using default building blocks, which means each component must be customized individually. To do so, click Edit in the upper-right corner, then select the mega menu. Then:

  • Edit the text directly within the building block.

  • Edit a menu item's URL by selecting the mega menu item and clicking the Edit button.

    メガメニューオプションを編集します。
  • 関連するブロックをメガメニュー内の目的の位置にドラッグアンドドロップして、メニュー項目を移動します。

  • Delete a menu item by clicking the (Remove) icon of the related block.

Mega menu design

To customize the general layout of the mega menu and its individual building blocks, open the website editor, go to the Style tab, and navigate to the Mega Menu section. The following options are available:

  • :guilabel:`テンプレート`を選択します。

  • :guilabel:`サイズ`を選択します: :guilabel:`全幅`または:guilabel:`狭幅`のいずれかです。

  • Toggle eCommerce Categories if applicable.