Why You Should Write a Sitecore Module

Author

Brandon Bruno

Published

January 09, 2018

Tags

Why You Should Write a Sitecore Module

What is a Sitecore Module?

In short, a Sitecore module extends, replaces, supplements, or provides new functionality to Sitecore. Modules are typically installed via Sitecore ZIP packages, but a module can be added via software builds or even manually via a copy & paste of the necessary files.

The Sitecore Marketplace is an online repository that hosts many popular Sitecore modules, including:

Anyone can submit a module to be published on the Marketplace. Modules do not have to be hosted on the Marketplace, but doing so helps with discoverability.

What Makes Up a Sitecore Module?

A Sitecore module is simply a combination of custom code, content items, and configuration that work together to provide some kind of functionality to Sitecore. A Sitecore module typically consists of (but is not limited to):

  • Sitecore items: content, settings, media, layouts, renderings - whatever is necessary to provide the module's functionality; module-related settings should be grouped under the /sitecore/System/Modules/<your_module> in the master database
  • Configuration: any and all configuratzion necessary for the module (new pipelines, patches, app settings, etc.)
  • Custom C# code: the heart of most modules - compiled backend code that makes it all possible
  • JavaScript applications: whether SPEAK-based or custom, JavaScript can also play a role in building module functionality
  • Other programs: any external applications or tools that support the module

A module is developed in your local Sitecore environment, using the same tools and development stack that you're already familiar with as a Sitecore developer. The necessary DLL files, Sitecore items, configuration, etc. are then bundled into a Sitecore ZIP package for distribution on the Sitecore Marketplace or other platforms.

Why Should You Write a Sitecore Module?

Writing a Sitecore module can be a rewarding endeavour.

First and foremost, a module can add new features to Sitecore. One of Sitecore's strenghts as a platform is its extensibility, and almost every Sitecore project requires customization on top of the base product. A module is a great way to provide common, re-usable functionality for new and old projects alike.

While you can write modules for internal use, sharing your creation on the Marketplace is a great way to get involved in the Sitecore community. Go a step further and open source your code. With your work in view of the public, other developers have a chance to provide feedback on your code, submit bugfixes, and add new features via pull requests. If your idea for a module is already served by an open source community module, see if you can contribute bug fixes or new features.

Finally, writing a module is one of the best ways to learn all about the inner workings of Sitecore. While Sitecore has lots of documentation available for major pieces of the platform, there is still a lack of deep technical documentation readily available (this is where the community helps!). A good Sitecore developer doesn't just write quality code, they know how and where to write quality code to interact with Sitecore's libraries and processes. Because a module may hook deep into Sitecore (altering pipeline processors, patching existing configuration, etc.), learning how these things work in the first place is crucial to writing a quality module. To help you dive into Sitecore's binaries, use a tool like dotPeek to crack open files like Sitecore.Kernel.dll and Sitecore.Mvc.dll.

Do you have questions, comments, or corrections for this post? Find me on Twitter: @BrandonMBruno