Plugins

Mura CMS is designed primarily to allow users to create, organize and manage static content on a web site. It includes many tools for organizing and distributing this content and has a host of administrative tools to assist in this primary goal, but often there is a need for a website to do more.

Often this is a fairly more task specific, such as organizing and hosting a wide library of images or including discussion forums. Requirements can also include the customization of the content administration process, the addition of e-commerce functionality, or connection to or integration of an existing external application.

These efforts usually require a degree of custom coding, and can often include the use of or replacement of standard Mura CMS functionality. The chief concern when undertaking this type of work is that it avoids changes to the core Mura CMS codebase.

One of Mura CMS's great strengths is that is easily updated to the latest version via the Upgrade Core and Upgrade Site options. If changes are made to the codebase, these functions instead become dangerous as they could easily overwrite any custom changes you might have made. Because of this, there is one fundamental rule when extending Mura CMS: Keep your changes update safe!

Why Plugins?

The chief way we achieve update-safe customizations to Mura CMS is through the Plugin architecture. Plugins are a seamless way of extending Mura CMS or adding completely new functionality. Being update-safe is only one of the advantages of plugins, others being:

  • Easily hook into the core Mura CMS API
  • Can optionally include administrative, event-based and/or front-end views and functionality
  • Are portable and easily updatable
  • Benefit from a non-binding exception in Mura CMS's GPL 2.0 license

When Plugins?

As you've seen in previous examples, there are many routes in extending and customizing Mura CMS in an update-friendly way, so you may ask yourself "when is the right time to build a plugin?". As a general rule of thumb, it is best to build your customizations into a plugin when:

  • You intend on putting your customizations on multiple Mura CMS installs
  • You are building a related set of customizations that would benefit from being organized together
  • You want to distribute your customizations
  • You want to manage your customizations separate from a Mura CMS install
  • Your customization includes brand new functionality

How Complicated?

Often the reluctance in building customizations into a plugin comes from the perception that a plugin might be more complicated or difficult to build, or that it requires a great deal of custom code and understanding of Mura's inner workings.

Happily neither of these is the case. Plugins are actually very easy to build and manage, and because they are packaged so neatly it is often much easier to maintain customizations within a plugin as opposed to overrides in the display_objects/custom folder or even within a theme.