Skip to content

There are two ways to add a theme to Orchard. The first and easiest is to use the Gallery tab on the Themes page in the dashboard to browse and install themes from an online feed of available themes. The second is to go to the dashboard Themes page and click the link to install a theme, which allows you to browse for a theme package on your local computer and install it.

有两种方法可以将主题添加到Orchard。第一个也是最简单的方法是使用仪表板中主题页面上的 Gallery 标签,从可用主题的在线Feed中浏览和安装主题。第二种是转到仪表板主题页面,然后单击链接以安装主题,这样您就可以在本地计算机上浏览主题包并进行安装。

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应用程序池标识的服务帐户。但是,您应该删除生产服务器上的写入权限。

Installing a Theme from the Gallery

从库中安装主题

When the gallery feature is enabled, as it is by default in Orchard, a Gallery tab appears at the top of the both the Themes screen and the Modules screen in the dashboard.

启用图库功能时,默认情况下在Orchard中,图库选项卡将显示在主题屏幕的顶部和仪表板中的模块屏幕上。

Note

!注意

If the gallery feature has been disabled, there will be no **Gallery** tab visible in the **Themes** or **Modules** dashboard screens.

To enable a disabled gallery, click **Modules** in the dashboard, and click **Enable** on the Gallery feature.

In the Themes screen of the dashboard, click the Gallery tab. A set of themes appears with a pair of Install and Download links next to each theme.

在仪表板的主题屏幕中,单击图库选项卡。出现一组主题,每个主题旁边都有一对 Install Download 链接。

To install a theme in your site, click the Install link next to the theme. Installing a theme adds it to your site in the Available list of themes on the Themes page in the dashboard. From there, you can preview a theme or set it as the current site theme, as described Previewing and Applying a Theme.

要在您的站点中安装主题,请单击主题旁边的 Install 链接。安装主题会在仪表板的主题页面的可用主题列表中将其添加到您的站点。从那里,您可以预览主题或将其设置为当前网站主题,如[预览和应用主题](预览和应用主题)所述。

Installing a Theme from your Local Computer

从本地计算机安装主题

To install a theme from your local computer, in the Themes screen of the dashboard, click the link to Install a theme from your computer. This displays a screen that lets you install a theme.

要从本地计算机安装主题,请在仪表板的主题屏幕中,单击指向从计算机安装主题的链接。这将显示一个允许您安装主题的屏幕。

Browse to a local package file that contains a theme (the file will have a .nupkg extension), select it, and then click Install. The theme package is installed in your site, and you will see the theme listed in the Available section of the Themes screen.

浏览到包含主题的本地包文件(该文件将具有_.nupkg_扩展名),选择它,然后单击安装。主题包安装在您的站点中,您将看到主题屏幕的可用部分中列出的主题。

Note A theme contains a number of files and folders packaged in a ZIP file that has a .nupkg file extension. The packaging feature is provided by the NuGet package management system. Packaging themes and other add-ons is beyond the scope of this topic, but you can learn more at http://nuget.codeplex.com/.

注意主题包含打包在ZIP文件中的文件和文件夹,其文件扩展名为_.nupkg_。包装功能由NuGet包管理系统提供。打包主题和其他附加组件超出了本主题的范围,但您可以在[http://nuget.codeplex.com/](http://nuget.codeplex.com/)上了解更多信息。

The following illustration shows the Terra theme, which was previously downloaded to the local computer from the Gallery, after clicking the Install a theme from your computer link and installing it to an Orchard site. The installed theme appears in the Available section.

下图显示了Terra主题,该主题先前从图库中下载到本地计算机,然后单击从计算机安装主题链接并将其安装到Orchard站点。已安装的主题显示在 Available 部分中。

To use an example theme to test this feature, download an existing theme from the Gallery tab on the Themes page, then browse to the saved .nupkg file on your computer and install it as described previously.

要使用示例主题测试此功能,请从主题页面上的 Gallery 选项卡下载现有主题,然后浏览到计算机上保存的_.nupkg_文件并按照前面所述进行安装。

When a theme is installed, the theme files are placed in the ~/Themes folder. You can see the installed themes in your site by checking the Available section on the Themes page in the dashboard. For more information about how to preview themes and apply them to your site, see Previewing and Applying a Theme.

安装主题后,主题文件将放在_~ / Themes_文件夹中。您可以通过选中仪表板中主题页面上的可用部分来查看您网站中已安装的主题。有关如何预览主题并将其应用到您的网站的详细信息,请参阅[预览和应用主题](预览和应用主题)。

Change History

改变历史

  • Updates for Orchard 1.1

  • Orchard 1.1的更新 *

    • 3-21-11: Updated screen shots and text for installing themes.