Skip to content

This topic targets, and was tested with, the Orchard 1.8 release. It also includes a reference to navigation in Orchard <1.5

  • 本主题针对Orchard 1.8版本进行了测试,并进行了测试。它还包括Orchard的导航参考<1.5 *

There are different ways to build up a menu structure. Here we will show two common methods that could be used:

有不同的方法来构建菜单结构。在这里,我们将展示可以使用的两种常用方法:

  • Adding menu items first, content later.

  • 首先添加菜单项,稍后添加内容。 *

  • Content first, navigation later.

  • 内容先行,稍后导航。 *

Of course they are not mutually exclusive, you can alternate both methods in the same site.

当然它们不是互斥的,您可以在同一站点中替换这两种方法。

Adding Menu Items First, Content Later

首先添加菜单项,稍后再添加内容

This method could be prefered when you first want to style your website to see all menu items.

当您第一次想要设置网站样式以查看所有菜单项时,可以首选此方法。

In the Orchard administration panel click the Navigation menu item.

在Orchard管理面板中,单击 Navigation 菜单项。

You will see that there is a default menu available, called 'Main Menu'.

您将看到有一个默认菜单,称为“主菜单”。

The right side contains all types of menu items that you can add:

右侧包含您可以添加的所有类型的菜单项:

  • Content Menu Item

  • 内容菜单项 *

  • Custom Link

  • 自定义链接 *

  • Html Menu Item

  • Html菜单项 *

  • Query Link

  • 查询链接 *

  • Shape Link

  • 形状链接 *

  • Taxonomy Link

  • 分类链接 *

Click Add next to the Content Menu Item to add a new menu item.

单击内容菜单项旁边的添加以添加新菜单项。

On the 'Create Menu Item' page you can fill in the Menu text.

在“创建菜单项”页面上,您可以填写菜单文本。

Select Browse and link to any content item (e.g your Home Page). Later, when you have prepared your real target content item you can update the menu link.

选择浏览并链接到任何内容项(例如您的主页)。稍后,当您准备好真实目标内容项时,可以更新菜单链接。

Content First, Navigation Later

内容优先,稍后导航

Here we first create a new Page (or edit a Page).

这里我们首先创建一个新的页面(或编辑一个页面)。

Select New Page on the left menu. Create an About Us page. Give it a title and a body.

在左侧菜单中选择新页面。创建一个关于我们页面。给它一个标题和一个身体。

At the bottom check the Show on a menu checkbox to see the menu options

在底部选中在菜单上显示复选框以查看菜单选项

for that page. The Menu text is the name of your menu item. By default the Page link will be added to the Main Menu.

对于该页面。 菜单文本是菜单项的名称。默认情况下,页面链接将添加到主菜单

When you now Save your page and navigate to the Navigation menu item on the left side you will see

当你现在保存你的页面并导航到左侧的 Navigation 菜单项你会看到

that the new menu item that you created was added to the Main Menu.

您创建的新菜单项已添加到主菜单。

Creating A Submenu

创建子菜单

Creating a submenu is very easy:

创建子菜单非常简单:

Navigate to the Navigation section. If you hover over an already added Menu Item with your mouse, you'll see

导航到导航部分。如果你用你的鼠标将**悬停在已添加的菜单项上,你会看到

that you can drag and drop the Menu Item.

您可以拖放菜单项。

Simply drag the Menu Item a bit to the right until it snaps to a sub container. Remember that changes you made here won't be updated until you click the Save All in the bottom-right side of the page.

只需向右拖动菜单项,直到它捕捉到子容器。请记住,在您点击页面右下角的全部保存之前,您所做的更改不会更新。

Older Versions Of Orchard (Before 1.5)

Orchard的旧版本(1.5之前)

Managing menus in older versions of Orchard was quite different.

在旧版本的Orchard中管理菜单是完全不同的。

Orchard <1.5 has a very simple main menu feature that is a list of menu item text and links to display,

Orchard <1.5有一个非常简单的主菜单功能,它是菜单项文本列表和要显示的链接,

accessible from the Navigation link in the Orchard admin panel. When you add an item to the main menu

可从Orchard管理面板中的 Navigation 链接访问。将项目添加到主菜单时

using the page or blog post editor screens, a new entry is added here. You can use this screen to rename,

使用页面或博客帖子编辑器屏幕,这里添加了一个新条目。您可以使用此屏幕重命名,

reorder, and remove menu items. (This will not delete the content item; it will only remove the menu item).

重新排序,并删除菜单项。 (这不会删除内容项;它只会删除菜单项)。

You can also add arbitrary URLs in your menu, whether external or pointing to a page in your Orchard site,

您还可以在菜单中添加任意URL,无论是外部还是指向Orchard站点中的页面,

by adding a new menu item. Note that only items added in this way have an editable URL on this screen.

通过添加新的菜单项。请注意,只有以这种方式添加的项目才会在此屏幕上显示可编辑的URL。

Content item URLs must be edited from the editor screen for that content item instead.

必须从该内容项的编辑器屏幕编辑内容项URL。

To reorder menu items, type a numeric index in the "Position" textbox. Position indexes can be any of

要重新排序菜单项,请在“位置”文本框中键入数字索引。位置索引可以是任何一个

the following format:

格式如下:

  • Integer: 1, 2, 3, etc.

  • 整数:1,2,3等

  • Decimal: 1.1, 1.2, 1.3, etc

  • 十进制:1.1,1.2,1.3等

  • Multi-part number: 1.1.1, 1.2.1, 1.2.2, etc

  • 多部件号:1.1.1,1.2.1,1.2.2等

When you are satisfied with your changes, click Update All to update the main menu of your site

如果对更改感到满意,请单击全部更新以更新站点的主菜单

(effective immediately).

(立即生效)。

Change History

改变历史

  • Updates for Orchard 1.8

  • Orchard 1.8的更新 *

    • 4-24-14: Added screenshots. Now you can't create a Content Menu Item and leave empty the content item; updated that part. Changed a bit the structure to comply with Orchard style documentation guidelines.