Back to Home

Architecture Orchard CMS. Basic concepts

asp.net · asp.net mvc · orchard cms · cms

Architecture Orchard CMS. Basic concepts

    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 .

    Let me remind you that automatic download of Orchard is available from the application gallery using the Web Platform Installer, a quick access tool for web tools (click 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 to work with content. In this part of the tutorial, we will introduce you to the elements of the Orchard CMS that make up the CMS architecture.

    Components Used in Orchard CMS


    Orchard’s content management system is built on top of Microsoft’s technology and community-driven open source components.

    Table 2.1. Orchard CMS Architecture
    image

    Table 1 shows the hierarchy of Orchard CMS architecture components:
    • it is based on the IIS web server or Windows Azure cloud services , which can host sites created using Orchard. In addition, it is possible to run Orchard CMS based on Mono in environments that are 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 for supporting MVC architectural template, which is distributed open source under the free MS-PL license;
    • NHibernate is an open source project that is an ORM, a tool for mapping (mapping) database objects to classes in the source code;
    • Autofac is an open source project that is an implementation of an IoC container for injecting dependencies in code. Orchard makes extensive use of the Dependency Injection mechanism;
    • Castle is a large open source project from which only Castle Dynamic Proxy is used in Orchard to generate proxy classes at runtime. Proxy classes are used to intercept calls to class members without modifying the code of this class itself;
    • 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, providing modularity and more;
    • Orchard core is a set of basic modules that are basic and are part of the CMS: routing, navigation, content syndication module;
    • Orchard modules are additional elements that extend the functionality of the CMS, some modules are included in the CMS package, others are created by the community and are available in the module galleries on the official website. To create the necessary functionality, you will create your modules, thus expanding the CMS as the task before you requires;
    • 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 are likely to create your own themes for websites.

    Key Concepts of Orchard CMS


    Orchard CMS, like any content management system, operates with a number of concepts. You need to know these concepts 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 are pages, blog posts, products.

    Content Types

    Content items are instances of content types. We can 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 will be “product” and so on.

    Content part

    In Orchard CMS, content types are built from small pieces called “pieces of content”. Parts of the content are the smallest indivisible unit that makes up the content. Parts of the content may be reused for other types of content.

    clip_image002 [4]
    Fig. 2.1. Example Orchard CMS Content Parts

    Figure 1 shows an example of Orchard CMS content parts. The following parts of the content are defined for the content type “blog entry”: a route (consisting of a title, a certain part of the URL, a content attribute for the main page), blog entry text, blog entry tags, comments for the entry, owner of the blog entry, date and time of the postponed publication .

    For a particular type of content, only one piece of 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 certain type of content, several identical content fields may exist.

    For example, the content type “product” may have a content text field “product stock number”, a numerical content field “product price”, and another numerical content field “product weight”. All of these content fields are only relevant to the product.

    It is important to understand the difference between a piece of content and a content field. Part of the content can be defined for the content type only once, the fields can be determined multiple 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 certain type.

    image
    Fig. 2.2. Scheme of two types of content and one part

    Orchard system offers the ability to form a part of content that will contain several properties at once. This allows you to use a single part with a set of properties instead of a set of content fields. For example, instead of creating several fields “number”, “cost”, “weight” for the content type “product”, you can create a part of the “Product properties” content with three identical properties. Such a part can be applied in the future to any type of content, not only to the “product”.

    Figure 2.2 shows a diagram of two types of content: “Product” and “Material”. Each type of content has its own content fields that are specific to it. On the other hand, the diagram shows a part of the content “Item Properties”, which can be used both with the “Product” type and with the “Material” type.

    Thus, content fields and parts of content are two complementary and overlapping options for generating content types.

    Module

    Most extensions of the functionality of Orchard CMS 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 on any site based on Orchard CMS.

    clip_image002 [6]
    Fig. 2.3. List of installed modules in the Orchard CMS administration panel

    Orchard CMS offers several basic 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).

    clip_image004
    Fig. 2.4. List of available modules in the Orchard CMS admin panel

    Feature

    Each module may contain one or more functions that represent a specific functionality. Certain module functions in the Orchard CMS system can be turned on and off on demand.

    clip_image006
    Fig. 2.5. Managing module functions in the Orchard CMS administration panel

    For example, a user authentication module includes functions to support authentication systems OpenId, LiveId, Facebook, Twitter. Each of the functions can be disabled, so the site developer flexibly defines the set of authentication services available to users on the site.

    The functions of the modules are controlled through the administration panel (Figure 2.5).

    Manifest

    A manifest is a small text file that contains a description of an Orchard CMS module or theme. Manifests can contain a set of parameters for the initial configuration of the module.

    The following is an example manifest for the comment module:

    Name: Comments

    AntiForgery: enabled

    Author: The Orchard Team

    Website: orchardproject.net

    Version: 0.9.0

    OrchardVersion: 0.9.0

    Description: The comments system implemented by this 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…

    Read Next