This article mainly refers to the official documentation "How orchard works" and orchardch translation.
The source code analysis should be done without looking at the leopard or the blind. Therefore, I first have a general understanding of the orchard architecture and some basic concepts. Creating a web-based CMS (Content Management System) is different from creating a common web application. Program : It is more like creating an application container. Such a system must be highly open and scalable. However, as a scalable system, it may face the challenge of application "availability": the combination of core modules in the system and unknown future modules, including integration at the user interface level. Orchard is the key to combining small components in relatively independent modules to form a coherent whole. We can make an analogy. If orchard corresponds to the operating system, the core module corresponds to the system software, the custom module corresponds to a third-party application, and the menu (foreground or background) corresponds to the Start Menu. When orchard is started, some modules need to be loaded, corresponding to the system services started from the operating system. This article explains what kind of architecture orchard chooses and how to achieve flexibility and a good user experience.I. orchard Architecture The top three layers are orchard. Orchard runs on. NET/ASP. NET and uses several open-source frameworks or class libraries including ASP. net mvc. At the underlying level of orchard is the orchard framework (orchard. Framework Assembly), which is the core module and other modules from the official or unofficial ). In fact, we can develop on any layer. We usually develop on the modules layer, create a new module/theme or modify an existing module/theme. Ii. orchard Basics Orchard CMS is built based on existing frameworks and libraries, including ASP. net mvc, nhib.pdf, autofac, and Castle. Iii. orchard framework (orchard. Framework Assembly) Orchard. Framework Assembly is located at the underlying layer of orchard. It contains the application engine and is not suitable for separating to modules. These are the most basic things, and even the most basic modules will have to rely on it. You can think of it as the basic class library of orchard. 4. orchard core module (orchard. Core Project and orchard. Core Assembly) The orchard. Core Project contains a set of required modules for running orhcard. Other modules can be safely dependent on these modules because these modules are always available. For example, feeds, navigation, and routable modules. Of course, as mentioned above, we can develop based on any layer of orchard. If necessary, we can design "core" by ourselves ". V. Module (moduls) The default release of orchard includes some built-in modules such as blogging and pages, and it is also convenient to create third-party modules. Extends the ASP. net mvc area that is used to expand the orchardpackage containing the module.txt file. A module usually contains event handlers, content types, their default rendering templates, and some management interfaces (Admin UI ). Modifications to the module ". csproj" file or ". csproj" reference file can automatically compile the module dynamically. That is to say, you can create or edit a module without compiling the module into a static assembly or even using vistual studio. 6. Themes) The topic allows orchard users to customize the site display interface and customize the site style they want. The topic can also specifically rewrite any template provided by the orchard module, or even change the image and layout. The topic is stored in the themesfolder under the orchardwebsite root directory and contains the theme.txt file. VII. Tenant/sub-site (tenants) Orchard supports sub-sites, that is, multiple sites with different domain names or different URL prefixes are deployed in a set of programs and an application domain. Reference: How orchard works