This is a continuation of a series of articles on the development of your own sites based on the Orchard CMS content management system. The first articles in this series can be found at the following links:
In the previous parts we learned about the possibilities of expanding the Orchard CMS through the creation of widgets and individual modules. This article focuses on working with ready-made modules, their packaging in packages and distribution.
Module packaging and distribution
After developing an extension for Orchard, you may want to distribute it to other developers. Orchard offers the function of creating packages containing modules for their distribution. In order to enable this function on your website, you need to activate the Packaging function in the administrative panel in the Modules section:

')
Another way to activate this function is to manage it via the command line. To use the command line, run bin \ orchard.exe from the root folder where the Orchard project is installed. Next, run the following command:
orchard> feature enable Orchard.Packaging
After activating the packaging function, the command line utility can support some additional functions that can be used to create a package (in
NuGet format) from any module in your Orchard installation. In addition, using the utility it will be possible to install third-party .nupkg packages on the site system. Information on these new command line features is provided below:
package create <extensionName> <path>
Create a package for the extension <extensionName>
(an extension being a module or a theme).
The package will be output at the <path> specified.
The default filename is Orchard. [Module | Theme]. <ExtensionName>. <ExtensionVersion> .nupkg.
For example, "package create SampleModule c: \ temp" will create the package
"c: \ temp \ Orchard.Module.SampleModule.1.0.0.nupkg".
package install <packageId> <location> / Version: <version>
Install a module file.
package uninstall <packageId>
Uninstall a module or a theme.
The <packageId> should take the format Orchard. [Module | Theme]. <ExtensionName>.
For example, "package uninstall Orchard.Module.SampleModule" will be the directory and
"package uninstall Orchard.Theme.SampleTheme" will uninstall the Theme under the "~ / Themes / SampleTheme" directory.
user create / UserName: <username> / Password: <password> / Email: <email>
Creates a new User
By running the “package create” command you can create a ready-made package.
orchard> package create Lucene C: \ Temp
Package "C: \ Temp \ Orchard.Module.Lucene.1.0.0.nupkg" successfully created
When creating packages, Orchard uses the
NuGet package manager package format (in fact, this is a regular zip archive with some metadata files inside). NuGet is based on the OPC package format, which you can find out at the following link
Open_Packaging_Conventions .
Now that you have created the package, you can distribute it to other Orchard-based website developers. Orchard CMS has the ability to select and install packages in the Modules section of the administration panel. You can learn about installing and updating modules from
this article .
Additionally, Orchard CMS offers a package gallery feature, with which you can register one or more list of third-party packages with modules ready for installation. CMS users in the future can easily add from these lists the necessary modules for their site. When installing Orchard CMS, one default package list is added to the gallery, which is the official list of extensions from the Orchard CMS project site. Learn how to add additional package lists to the site’s gallery
here .
You can use the administration panel or the online gallery at
http://orchardproject.net/gallery to download and install the packages or themes you need for your website.
You can easily distribute your package for other developers by downloading it to the official website from the package galleries.
Register and add your package on the page at
this link .