標籤:
原文地址:http://docs.orchardproject.net/Documentation/Working-with-Orchard-in-WebMatrix
最近想要學習瞭解orchard,但卻沒有找到相關的中文文檔,只有英文文檔。於是決定自行翻譯,以便日後方便翻閱。
轉載請註明原作者與出處。
本人英文水平有限,錯誤之處歡迎指出以便修正。
讓Orchard在WebMatrix下工作
WebMatrix,微軟的一站式web開發工具,讓你建立、編輯、發布web網站時擁有前所未有的便捷。WebMatrix包括嵌入式的web服務(IIS Express),以及如同Orchard般簡單易用的編輯器來自訂網站應用程式。當使用Web Platform Installer安裝Orchard時,可以通過選項用WebMatrix替代IIS。
安裝並運行WebMatrix Installing and Launching WebMatrix
下載並運行Microsoft Web Platform Installer,點擊Microsoft WebMatrix的Add按鈕後點擊Install。
當安裝完成時接受許可協議後運行WebMatrix。
使用WebMatrix建立一個基於Orchard的web網站
要使用WebMatrix建立基於Orchard的web網站,在WebMatrix的啟動頁面中點擊App Gallery。
向下拖動捲軸找到並選擇Orchard CMS,為你的網站所使用的檔案夾輸入名稱(譯者注:圖中Site Name處) 。舉例來說,如果輸入的網站名稱是"Orchard CMS",將會建立檔案夾"Documents/My Websites/Orchard CMS"。點擊Next繼續下一步。
點擊I Accept來接受終端使用者許可協議。
一個新的子檔案夾,"Orchard CMS"將會被添加到"My Websites"檔案夾下。點擊OK。你的Orchard網站將會在Web Matrix Your Orchard中開啟並且"Orchard Setup"頁面將會在新的瀏覽器視窗中啟動。
在Orchard安裝頁面關於網站的輸入基本資料。必須明確之處:網站名稱,使用者密碼,網站資料庫類型,Orchard配方。
如果你僅僅是想要儘快使用Orchard,我們建議你選擇SQL Compact Server資料庫類型並使用Default配方(recip)。輸入所有必備資訊後點擊Finish Setup。
點擊按鈕後,Orchard會在網站初始化完成後在瀏覽器視窗中開啟網站首頁。你將會自動使用剛剛設定的使用者資訊登陸(剛剛設定的是admin使用者)。在該處,點擊Dashboard將會帶你進入Orchard Dashboard頁面,在那裡可以改變一些網站配置。
Running your website from Web Matrix
At any point in time, you can run your website from WebMatrix by selecting the project node and clicking Run.
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.
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.
You can change the editor WebMatrix uses by following these instructions.
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 filefiletypes.xml (which can be found in the following locations):
32-bit machines: C:\Program Files\Microsoft WebMatrix\config\filetypes.xml64-bit machines: C:\Program Files (x86)\Microsoft WebMatrix\config\filetypes.xml
1) Add the .info file extension to the list of XML file types:
<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:
<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.
Working with the Database
If you selected SQL Server Compact for the the database option in Orchard setup, you can open theOrchard.sdf database in WebMatrix by selecting Databases.
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.)
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.
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. 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 ?????
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. You can use these settings by selectingImport 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. 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 theRemote View.
More information about using WebMatrix to publish websites can be found here.
Orchard官方文檔翻譯(四) 讓Orchard在WebMatrix下工作