WebMatrix, Microsoft's one-stop web development tool, lets you create, edit, and publish websites with unprecedented ease. WebMatrix includes a built-in web server (IIS Express), along with a simple editor for editing and customizing applications like Orchard. When installing Orchard using the Web Platform Installer, you have the option to install to
[WebMatrix](http://www.microsoft.com/web/webmatrix/)是Microsoft的一站式Web开发工具,可让您以前所未有的轻松创建,编辑和发布网站。 WebMatrix包括一个内置的Web服务器(IIS Express),以及一个用于编辑和自定义Orchard等应用程序的简单编辑器。使用Web Platform Installer安装Orchard时,您可以选择安装到
WebMatrix instead of IIS.
WebMatrix而不是IIS。
Installing and Launching WebMatrix
安装和启动WebMatrix
Download and launch the Microsoft Web Platform Installer Then click the Add button for Microsoft WebMatrix and click Install.
下载并启动Microsoft [Web平台安装程序](http://www.microsoft.com/web/downloads/platform.aspx)然后单击添加按钮以获取 Microsoft WebMatrix 并单击安装。
Accept the license terms and launch WebMatrix when the installation finishes.
接受许可条款并在安装完成后启动WebMatrix。
Using WebMatrix to create an Orchard Website
使用WebMatrix创建Orchard网站
To create an Orchard Website using WebMatrix, click App Gallery on the WebMatrix startup page.
要使用WebMatrix创建Orchard网站,请单击WebMatrix启动页面上的 App Gallery 。
Scroll down and select Orchard CMS. Enter a name to be used as the folder name for your site. For example, if the site name "Orchard CMS" is entered, the folder "Documents/My Websites/Orchard CMS" will be created. Click Next.
向下滚动并选择 Orchard CMS 。输入要用作站点的文件夹名称的名称。例如,如果输入站点名称“Orchard CMS”,则将创建“Documents / My Websites / Orchard CMS”文件夹。点击下一步**。
Click I Accept to accept the EULA agreement.
点击我接受接受EULA协议。
A new subfolder, "Orchard CMS", will be added to your "My Websites" folder. Click OK. Your Orchard site will then be opened in Web Matrix and the "Orchard Setup" page will be launched in a new browser window.
新的子文件夹“Orchard CMS”将添加到“我的网站”文件夹中。单击确定。然后,您的Orchard站点将在Web Matrix中打开,“Orchard Setup”页面将在新的浏览器窗口中启动。
Enter basic information about your site on the Orchard Setup page. Specifically: the name of the site, the name of a user of the site, the user's password, the kind of database to use for site data, and the Orchard recipe.
在Orchard Setup页面上输入有关您站点的基本信息。具体来说:站点的名称,站点用户的名称,用户的密码,用于站点数据的数据库类型以及Orchard配方。
If you are just starting out using Orchard, we recommend that you select SQL Compact Server for the database and Default for the recipe. Enter the information and click Finish Setup.
如果您刚刚开始使用Orchard,我们建议您为数据库选择 SQL Compact Server ,为配方选择 Default 。输入信息,然后单击完成设置。
Orchard sets up your initial site and then opens a browser window with the site's home page. You will automatically be logged in with the user name you specified in setup (in this case, admin). At this point, clicking on Dashboard
Orchard设置您的初始站点,然后打开一个包含该站点主页的浏览器窗口。您将使用您在设置中指定的用户名自动登录(在本例中为 admin )。此时,点击仪表板
will take you to the Orchard Dashboard where website changes can be made.
将带您进入可以进行网站更改的[Orchard Dashboard](绕过仪表板)。
Running your website from Web Matrix
从Web Matrix运行您的网站
At any point in time, you can run your website from WebMatrix by selecting the project node and clicking Run.
在任何时候,您都可以通过选择项目节点并单击 Run 从WebMatrix运行您的网站。
Working with Files
使用文件
You can use WebMatrix to edit the files in your Orchard installation. WebMatrix provides a simple editor that includes colorization for HTML, CSS, JavaScript, and code files.
您可以使用WebMatrix编辑Orchard安装中的文件。 WebMatrix提供了一个简单的编辑器,其中包括HTML,CSS,JavaScript和代码文件的着色。
Although WebMatrix does not provide a build system for compiling code files, Orchard itself provides dynamic compilation for code files when they are edited. For more information, see Orchard Dynamic Compilation.
虽然WebMatrix没有提供用于编译代码文件的构建系统,但Orchard本身在编辑代码文件时提供动态编译。有关更多信息,请参阅[Orchard动态编译](Orchard-module-loader-and-dynamic-compilation)。
You can change the editor WebMatrix uses by following these instructions.
您可以按照这些[说明](http://sybak.com/blog/2011/02/changing-the-file-types-that-open-with-webmatrix/)更改WebMatrix使用的编辑器。
As an example, you may find it helpful to use the XML editor (which provides colorization) on the Placement.info
file. To do this you must change the setting for .info
files in the WebMatrix file filetypes.xml
(which can be found in the following locations):
例如,您可能会发现在Placement.info
文件中使用XML编辑器(提供着色)很有帮助。为此,您必须更改WebMatrix文件filetypes.xml
中的.info
文件的设置(可在以下位置找到):
32-bit machines: C:\Program Files\Microsoft WebMatrix\config\filetypes.xml
64-bit machines: C:\Program Files (x86)\Microsoft WebMatrix\config\filetypes.xml
1) Add the .info
file extension to the list of XML file types:
1)将.info
文件扩展名添加到XML文件类型列表中:
<FileType extension=".info;.config;.csproj;.vbproj;.resx;.settings;.sitemap;.user;.wsdl;.browser;.xaml;.xml;.xoml;.xsd;.xsl;.xslt;.mxml;.dbml;.wstemplate">
<OpenAs>XML</OpenAs>
<TabColor>Yellow</TabColor>
<Icon>XMLFileIcon</Icon>
<EmitUtf8BomByDefault>True</EmitUtf8BomByDefault>
<Description>An XML File</Description>
</FileType>
2) Remove the .info
file extension from the list of Text file types:
2)从文本文件类型列表中删除.info
文件扩展名:
<FileType extension=".ashx;.export;.po;.blogtemplate;.yml;.yaml;.manifest;.pl;.json;.csv">
<OpenAs>Text</OpenAs>
<TabColor>Gray</TabColor>
<Icon>DefaultFileIcon</Icon>
<EmitUtf8BomByDefault>False</EmitUtf8BomByDefault>
<Description>Unknown file type</Description>
</FileType>
3) Restart WebMatrix to apply the change.
3)重新启动WebMatrix以应用更改。
Working with the Database
使用数据库
If you selected SQL Server Compact for the the database option in Orchard setup, you can open the Orchard.sdf database in WebMatrix by selecting Databases.
如果在Orchard安装程序中为数据库选项选择了 SQL Server Compact ,则可以通过选择数据库在WebMatrix中打开 Orchard.sdf 数据库。
Once the database window is opened, you can view the contents of a table by selecting the table in the explorer pane.
打开数据库窗口后,可以通过在资源管理器窗格中选择表来查看表的内容。
(If you were already in the Databases workspace, you might need to right-click the Orchard node and then click Refresh in order to display the database and tables.)
(如果您已经在 Databases 工作区中,则可能需要右键单击Orchard节点,然后单击 Refresh 以显示数据库和表。)
Publishing Your Web Site
发布您的网站
When you're ready to upload the local copy of your website to the Internet, click the Publish button in the WebMatrix ribbon.
当您准备将网站的本地副本上载到Internet时,请单击WebMatrix功能区中的发布按钮。
The first time you publish, the Publish Your Site dialog box is displayed.
首次发布时,将显示发布您的站点对话框。
To publish a website, you must have an account with a web hosting provider. If you don't have one yet, you can select either Get Started with Windows Azure or Find Windows Web Hosting.
要发布网站,您必须拥有一个拥有网络托管服务提供商的帐户。如果还没有,可以选择 Windows Azure入门或查找Windows虚拟主机。
If you select Windows Azure, you will have the option of creating your website as either an Azure Website or Azure Web Role. For instructions on working with Azure see ?????
如果选择Windows Azure,则可以选择将网站创建为Azure网站或Azure Web角色。有关使用Azure的说明,请参阅?????
After you've set up an account with a hosting provider, the provider will typically send you an email with your user name, server name, and other information. To save you the extra step of entering this information manually, the provider might send you a "Profile XML" file (named with the .publishsettings extension) that contains this information.
在您与托管服务提供商建立帐户后,提供商通常会向您发送一封电子邮件,其中包含您的用户名,服务器名称和其他信息。为了省去手动输入此信息的额外步骤,提供程序可能会向您发送包含此信息的“Profile XML”文件(以_.publishsettings_扩展名命名)。
You can use these settings by selecting Import publish profile and then selecting the file provided by your hoster. Otherwise, you can enter the settings manually.
您可以通过选择导入发布配置文件然后选择主机提供的文件来使用这些设置。否则,您可以手动输入设置。
After you've published your site, you might want to make changes to it and republish it. When you subsequently select Publish, WebMatrix will list the local files that have been changed since the last time the local site was published.
发布站点后,您可能希望对其进行更改并重新发布。当您随后选择 Publish 时,WebMatrix将列出自上次发布本地站点以来已更改的本地文件。
At this point you can select which files you want to upload to the remote stie and select Continue or cancel.
此时,您可以选择要上传到远程站点的文件,然后选择继续或取消。
Once you have published your website, you can view the files in the remote site by opening the Remote View.
发布网站后,您可以通过打开远程视图来查看远程站点中的文件。
More information about using WebMatrix to publish websites can be found here.
有关使用WebMatrix发布网站的更多信息,请参见[此处](http://www.microsoft.com/web/post/how-to-publish-a-web-application-using-webmatrix)。
Change History
改变历史
-
Updates for Orchard 1.6
-
Orchard 1.6的更新 *
- 11-14-12: Updated screens and workflow.