This is the second part of the guide “
How to create your website from scratch using Orchard CMS ”. You can get acquainted with the first part of the guide here: the
beginning and the
continuation .
I remind you that the automatic download of Orchard is available from the application gallery using the Web Platform Installer's quick access tool (click on this link to start the installation ).Introduction
In order to start working with Orchard CMS, you need to learn the basic concepts that are used in this CMS for working with content. In this part of the tutorial, we will introduce the Orchard CMS elements that make up the CMS architecture.
')
Components used in Orchard CMS
The Orchard content management system is based on Microsoft technologies and open source components created by the community.
Table 2.1. Orchard CMS Architecture
Table 1 shows the hierarchy of components of the Orchard CMS architecture:
- it is based on the IIS web server or Windows Azure cloud services where sites created using Orchard can be hosted. In addition, it is possible to launch Mono- based Orchard CMS in environments supported by Mono;
- Orchard CMS platform is a platform . Microsoft's NET and its ASP .NET web infrastructure;
- ASP .NET MVC is an ASP.NET-based framework that supports the MVC architectural template that is distributed open source under the free MS-PL license;
- NHibernate is an open source project, which is ORM, a tool for matching (mapping) database objects with classes in the source code;
- Autofac is an open source project that represents the implementation of an IoC container for dependency injection in code. Orchard makes extensive use of Dependency Injection;
- Castle is a large open source project from which Orchard uses only the Castle Dynamic Proxy to generate proxy classes during execution. Proxy classes are used to intercept calls to class members without modifying the code of this class itself;
- The Orchard framework is the entire CMS infrastructure that underlies the work: system initialization mechanisms, dependency injection, ASP.NET MVC routes, content type systems, transactions, request life cycle, provision of modularity, and more;
- Orchard core is a set of basic modules that are basic and are included in the CMS: module of routing, navigation, content syndication;
- Orchard modules are additional elements that extend the functionality of the CMS, some of the modules are included in the CMS kit, others are created by the community and are available in the modules gallery on the official website. To create the necessary functionality, you will create your modules, thus expanding the CMS as it requires the task before you;
- Orchard themes are designed to change the appearance of sites created on the basis of CMS. Some themes are available from the online gallery, but in your work, you will probably create your own themes for websites.
Basic concepts Orchard CMS
Orchard CMS, like any content management system, operates with a number of concepts. These concepts need to be known to further explore how the system works and expands.
Content item
A content item is a small piece of information, often associated with a single address (URL). Examples of content elements include pages, blog entries, products.
Content types
Content items are instances of content types. To put it another way: content types are classes of content elements. For blog entries, the content type will be “blog entry,” for product products, the content type is “product” and so on.
Content part
In Orchard CMS content types are built from small parts that are called “content parts”. Parts of content are the smallest indivisible unit that makes up the content. Portions of the content may be reused for other types of content.
Fig. 2.1. An example of parts of content Orchard CMSFigure 1 shows an example of portions of content in Orchard CMS. For the content of the blog entry, the following parts of the content are defined: route (consisting of a header, some URL, content for the main page), blog entry text, blog entry tags, post comments, blog post owner, date and time of postponed publication .
For a single content type, only one part of the content can be defined.
Content Field
Content fields are pieces of information that can be added to a content type. Content fields have names and their own type, they are specific to each type of content. For a particular type of content, there may be several identical content fields.
For example, the content type “product” may have a content text field “warehouse item number”, a numeric content field “product price”, and another numeric content field “product weight”. All these content fields are related only to the product.
It is important to understand the difference between the content part and the content field. Part of the content can be defined for the type of content only once, the fields can be determined many times. On the other hand, parts of the content can be used for different types of content, but the content fields are rigidly assigned to a specific type.
Fig. 2.2. Scheme of two types of content and one partThe Orchard system offers the opportunity to form part of the content that will contain several properties at once. This allows you to use instead of a set of content fields one single part with a set of properties. For example, instead of creating for the content type “product” several fields “number”, “value”, “weight” you can create a part of the content “Product properties” with three identical properties. This part can be applied in the future to any type of content, not only to the “product”.
Figure 2.2 shows a diagram of the two types of content “Goods” and “Material”. Each content type has its own content fields that are specific to it. On the other hand, the scheme presents part of the content “Item Properties”, which can be used both with the “Goods” type and the “Material” type.
Thus, the content fields and parts of the content are two complementary and intersecting variants of the formation of content types.
Module
Most Orchard CMS functionality extensions should be created as special modules. In fact, a module is a set of extensions for Orchard, which are grouped together and located in one subfolder in the Modules directory, which is in any Orchard CMS-based website.
Fig. 2.3. List of installed modules in the Orchard CMS admin panelOrchard CMS offers several main modules included in the CMS core (Figure 2.3). Other modules can be downloaded from the online gallery accessible from the site administration panel (Figure 2.4).
Fig. 2.4. List of available modules in the Orchard CMS admin panelFeature
Each module can contain one or several functions that represent a specific functionality. The individual functions of the modules in the Orchard CMS system can be turned on and off on demand.
Fig. 2.5. Management of module functions in the Orchard CMS administration panelFor example, a custom authentication module includes functions to support authentication systems OpenId, LiveId, Facebook, Twitter. Each of the functions can be disabled, so that the site developer flexibly determines the set of authentication services available to users on the site.
The functions of the modules are managed through the administration panel (Figure 2.5).
Manifest (Manifest)
A manifest is a small text file that contains a description of a module or theme for an Orchard CMS. Manifests can contain a set of parameters for the initial configuration of the module.
The following is an example of a manifest for a comment module:
Name: Comments
AntiForgery: enabled
Author: The Orchard Team
Website: orchardproject.net
Version: 0.9.0
OrchardVersion: 0.9.0
Description: The module can be applied to arbitrary Orchard content types such as blogs and pages. It includes comment validation and spam protection through the Akismet service.
Features:
Orchard.Comments:
Name: Comments
Description: Standard content item comments.
Dependencies: Settings
Category: Social
to be continued…