Skip to content

Orchard is a modular web-based CMS, designed to be extended easily by installing additional modules and enabling module features. A module is a package that can be installed and uninstalled. A package consists of a ZIP file in the .nupkg file format.) A feature is a behavior that's exposed by an installed module that you can individually enable or disable.

Orchard是一个基于Web的模块化CMS,旨在通过安装附加模块和启用模块功能轻松扩展。 module_是可以安装和卸载的软件包。 _package_由[.nupkg](http://nuget.codeplex.com)文件格式的ZIP文件组成。) feature_是由已安装的模块公开的行为,您可以单独启用或禁用该行为。

This topic shows you how to install or download modules from the online gallery, how to install a module from your local computer, and how to work with the features of an installed module. It also shows you how to update installed modules.

本主题介绍如何从在线库中安装或下载模块,如何从本地计算机安装模块以及如何使用已安装模块的功能。它还向您展示了如何更新已安装的模块。

Note If your site is running under IIS, make sure you have granted read/write permissions to the ~/Themes folder under the root of your site for the service account that is being used as the IIS application pool identity. However, you should remove the write permissions on a production server.

注意如果您的站点在IIS下运行,请确保您已授予对站点根目录下的_~ / Themes_文件夹的读/写权限,以用作用作IIS应用程序池标识的服务帐户。但是,您应该删除生产服务器上的写入权限。

Viewing Installed Modules

查看已安装的模块

To view the modules that have been installed for your site, click Modules on the dashboard, and then in the Modules screen, click the Installed tab.

要查看已为站点安装的模块,请单击仪表板上的 Modules ,然后在 Modules 屏幕中,单击 Installed 选项卡。

The Installed tab displays a list of the modules that are included with Orchard, along with properties of each module such as version, author, a description, and a list of features. It also provides a link that you can use to upload and install a module package.

Installed 选项卡显示Orchard附带的模块列表,以及每个模块的属性,例如版本,作者,描述和功能列表。它还提供了一个可用于上载和安装模块包的链接。

You can add modules to Orchard in two ways. The first and easiest is to install a module from the online gallery. The second is to upload a module package from your local computer and install it in your site. If you simply want to use an existing module in your Orchard site, you can install the module directly from the gallery to your site. If you want to modify a module package, or if you want to upload it to multiple Orchard sites, you will probably want to download the module from the gallery to your local computer.

您可以通过两种方式向Orchard添加模块。第一个也是最简单的是从在线图库安装模块。第二种是从本地计算机上传模块包并将其安装在您的站点中。如果您只想在Orchard站点中使用现有模块,则可以直接从库中将模块安装到您的站点。如果要修改模块包,或者要将其上载到多个Orchard站点,则可能需要将模块从库下载到本地计算机。

Installing a Module from the Gallery

从库中安装模块

When you install a module, its package file is downloaded from the gallery, and the source files are extracted from the package and added to your site. After you install a module, its features are available for use.

安装模块时,会从库中下载其包文件,并从包中提取源文件并将其添加到您的站点。安装模块后,可以使用其功能。

To install a module from the gallery, click Modules on the dashboard, then click the Gallery tab. The Gallery tab displays a list of available online modules from the gallery feed (or feeds) registered for your site.

要从库中安装模块,请单击仪表板上的 Modules ,然后单击 Gallery 选项卡。 图库标签显示了为您的网站注册的图库供稿(或供稿)中的可用在线模块列表。

The gallery displays the aggregated list of modules exposed by all registered feeds. You can also use the Feed drop-down list in the Gallery tab to display all feeds or to filter and display only the modules from a particular feed.

该库显示所有[已注册的供稿](Module-gallery-feeds)公开的模块的聚合列表。您还可以使用 Gallery 选项卡中的 Feed 下拉列表显示所有Feed,或仅过滤和显示特定Feed中的模块。

To install a module, click the Install link for the module. This topic uses the Bing.Maps module as an example.

要安装模块,请单击模块的 Install 链接。本主题使用 Bing.Maps 模块作为示例。

After the module has been installed, Orchard prompts you to enable features in the module. Select the features you want to enable and then click OK.

安装模块后,Orchard会提示您启用模块中的功能。选择要启用的功能,然后单击确定

When you return to the Installed tab, you can see the module that you just installed.

当您返回 Installed 选项卡时,您可以看到刚刚安装的模块。

Downloading a Module from the Gallery

从库中下载模块

At times you may want to simply download a module package to your computer rather than installing it in a site. To download a module, return to the Gallery tab and click Download for a specific module. (For example, download the Contact Form module.) The download process lets you save the .nupkg file that contains the module contents to your local machine. You can then optionally modify the module, or install it in an Orchard site.

有时您可能只想将模块包下载到您的计算机而不是将其安装在站点中。要下载模块,请返回 Gallery 选项卡,然后单击 Download 以获取特定模块。 (例如,下载 Contact Form 模块。)下载过程允许您将包含模块内容的_.nupkg_文件保存到本地计算机。然后,您可以选择修改模块,或将其安装在Orchard站点中。

Installing a Module from your Local Computer

从本地计算机安装模块

To install a module from your local computer to an Orchard site, go to the Modules > Installed tab and then click the link to Install a module from your computer.

要将模块从本地计算机安装到Orchard站点,请转到 Modules> Installed 选项卡,然后单击从计算机安装模块的链接。

Browse to the local module (a .nupkg file), select it, and then click Install. This installs the module package to your site the same way that clicking Install does for an online module in the gallery.

浏览到本地模块(_.nupkg_文件),选择它,然后单击安装。这会将模块包安装到您的站点,就像单击 Install 对库中的在线模块所做的那样。

Working with Module Features

使用模块功能

When you install a module in an Orchard site, the module contains one or more features. You can enable or disable each feature individually, either when you first install the module, or later. The Bing.Maps module used as an example in the previous section contains a single feature, also called Bing.Maps. (Remember that a module can have one or many features, and that the features do not have to have the same name as their parent module.) In this section, you'll see how to enable or disable an individual feature (the Bing.Maps feature), and how to add that feature to a content type, such as a page.

在Orchard站点中安装模块时,该模块包含一个或多个功能。您可以在首次安装模块时或单独启用或禁用每个功能。在上一节中用作示例的 Bing.Maps 模块包含一个功能,也称为 Bing.Maps 。 (请记住,模块可以具有一个或多个功能,并且功能不必与其父模块具有相同的名称。)在本节中,您将了解如何启用或禁用单个功能( Bing.Maps 功能),以及如何将该功能添加到内容类型(如页面)。

Begin by observing how to enable or disable the Bing.Maps feature. To do this, go to the Modules > Features tab, find the Bing.Maps feature. Note that it is enabled, and that you can disable it by clicking a Disable link on the feature. If the feature is disabled, then an Enable link appears for enabling the feature. Leave the feature enabled for this tutorial.

首先观察如何启用或禁用 Bing.Maps 功能。要执行此操作,请转到模块>功能选项卡,找到 Bing.Maps 功能。请注意,它已启用,您可以通过单击该功能上的禁用链接来禁用它。如果禁用该功能,则会出现 Enable 链接以启用该功能。保持为本教程启用该功能。

Now you can add a new content part (a Bing Map part, which is included in the disabled Bing.Maps feature) to the page content type. On the dashboard, click Content, and then click the Content Types tab. Find the Page content type, and then click Edit next to the type. In the Edit Content Type screen, click Add Parts in the Parts section. The Add Parts to Page screen is displayed.

现在,您可以向页面内容类型添加新的内容部分( Bing Map 部分,它包含在已禁用的 Bing.Maps 功能中)。在仪表板上,单击内容,然后单击内容类型选项卡。找到 Page 内容类型,然后单击类型旁边的编辑。在编辑内容类型屏幕中,单击部件部分中的添加部件。将显示 Add Parts to Page 屏幕。

Select the Bing Map content part from the list of available parts, and then save the updated page content type.

从可用部件列表中选择 Bing Map 内容部件,然后保存更新的页面内容类型。

Now you can see the effect of adding the Bing Maps content part to the page type. On the dashboard in the New menu, click Page to create a new page. Because you installed the Bing Maps module, enabled the feature, and added the Bing Map content part to the page, when you create a new page instance, a number of map-related fields appear.

现在,您可以看到将 Bing Maps 内容部分添加到页面类型的效果。在 New 菜单的仪表板上,单击 Page 以创建新页面。由于您安装了 Bing Maps 模块,启用了该功能,并将 Bing Map 内容部件添加到该页面,因此在创建新页面实例时,会显示许多与地图相关的字段。

Updating an Installed Module

更新已安装的模块

Occasionally modules will be updated with fixes or new features. You can update an installed module by clicking Modules on the dashboard and then clicking the Updates tab. If there are no updates available for your installed modules, the Updates tab is empty. If there are updates available, you can install or download the updates the same way that you installed the module originally.

有时,模块将使用修复程序或新功能进行更新。您可以通过单击仪表板上的 Modules 然后单击 Updates 选项卡来更新已安装的模块。如果没有可用于已安装模块的更新,则更新选项卡为空。如果有可用更新,则可以按照与最初安装模块相同的方式安装或下载更新。

Change History

改变历史

  • Updated for Orchard 1.1

  • 更新了Orchard 1.1 *

    • 3-23-11: Reordered sections of the topic, added new section on enabling and disabling features, plus another section on updating a module. Updated screens and text in existing sections.