SilverStripe Modules: An Overview

Posted by Stripes the Zebra on 24 March 2012

A strong yet flexible content management system or CMS for any website that is integrated with a framework for application is SilverStripe. It also integrates themes, widgets and evensilverstripe modules which becomes one of the cores of one's website. The excellent factor is that Silverstripe is open source and is compatible with most modern website formats such as php5 and mysql based systems that allows techies as well as newbies save precious time and nerves as well! The effortless and basic technique of the Silverstripe modules are very easily understood by non-technical ‘webmasters’ for content management.

Silverstripe modules are normally based on a framework named Sapphire and as such everything is manufactured around it. Silverstripe modules are normally a collection of templates, classes plus a amount of JS as well as other resouces. Some of these Silverstripe modules are readily obtainable for download on the silverstripe website or in case you believe you might be savvy enough, you are able to actually produce one on your own, depending on your needs.

You can definitely build subclasses like a SiteTree or even a page class. Now, a built-in or pre-built class can be replaced by your own class with the use of Object::YourOwnClass(). You may also make use of the decorator to improve the behavior of the made class, you are able to also location additional director rules in _config.php. You may also produce Silverstripe modules for various application that will be utilized as an extension like plug in or a widget perhaps.

Installation of Modules

Now prior to thinking about creating your own Silverstripe modules you can wish to visit the website to look at modules which are already obtainable for you. You may download and install the modules on your page, here are the steps:

1. Download the Module and extract the files. Now sometimes whenever you extract the files there's a version amount included in the prefix or suffix folder, you should right the folder name to make it work. For example, you downloaded a modules-image_gallery-r201 you need to make certain to rename your folder to image_gallery.

2. Copy the folder you extracted on the root folder of one's Silverstripe installation. Bear in mind that Silverstripe modules are often saved on the root directory of the installation.

3. Open your favorite browser and type in yoursitename/dev/build/. Don’t forget that in case you are working on the live website make certain that you simply have logged into the CMS before copying the Silverstripe modules on the silverstripe root directory prior to running /dev/build/

4. That’s it, your done. Your Silverstripe module has been installed and ready for use.

Creating Your own Modules

Of course in case you have the technical know how, or wish to try your hand at it, you are able to actually produce your own Silverstripe modules.

It's actually a great method to make use of abstract codes and templates across varying projects. Should you wish to add generic functions for your website like possibly a forum or an e-commerce package or even a blog all your own, you are able to do this by creating a root directory, this need to be at the exact same level as the “sapphire” or “cms” directory, two of the core modules for functionality and templating for ones default install of the system. After creating your newest root folder add an _config.php, in case you didn’t then Silverstripe will not read the Silverstripe Module you've created. Within your new module directory follow the directory structure guidelines.

Submitting Your SilverStripe Modules

If you would like to submit a module you've produced you are able to very easily do that but of course your work ought to adhere to specific code qualities as well as other conventions, documentations and release updates. It's your responsibility as the creator of the silverstripe modules.

It’s best to keep your module as generic as you possibly can. If you’re going to generate a forum module then your member’s area shouldn’t include fields like “YourLiveJournalName” or “Games You Like To Play”. Individual users can merely add these fields by using a sub-class to your class or by decorating the fields into it.

Whether you download your SilverStripe modules from the website or produce one on your own, these modules enable for bigger functionality and aesthetic quality of one's website.