Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Installing A Module
This guide covers how to download and install a module for BrowserCMS. With BrowserCMS, modules are packaged as Ruby Gems, which contain the code to add new behavior to a BrowserCMS project. Installing a module consists of several steps, including:
- Getting the Gem installed
- Installing the module in your project
- Running migrations
Once you have done the above steps, you should have access to the Content blocks and portlets that each module provides, and you can add them to your pages.
This guide is for BrowserCMS 3.3.
This module assumes you are going to be building installing module as gems. Let’s assume you want to install the News module, who’s project name (and gem name) is ‘bcms_news’. If you want to install other modules, just substitute the name of the module you want for ‘bcms_news’.
Before installing a module, its worth reviewing the file for the module. It may contain some specific instructions on how to install and use the module, in addition to the basic steps outlined here. The file can be found as the landing page on the github repository for a module. For example, the Page Comments module has an overview of the module and its installation instructions.
Getting the module from RubyGems
For modules released as gems, they should be hosted on RubyGems. You should be able to download gems via:
$ gem install bcms_news
At this point, the News module gem should be installed as a gem on your system, and can be added to your projects.
Adding the Module to your project
In your BrowserCMS application, do the following steps.
Run the install script
Modules can be installed by running rails generators inside your project. BrowserCMS comes with an install script that will add all the necessary code to your project.
$ rails g cms:install bcms_news
This will add the Gem to your Gemfile, add the routes, and perform any other installation scripts the module requires.
Run migrations and start the server
Modules will often add new data types, like content blocks, so you need to run the migrations to add them to your project.
$ rake db:migrate $ rails s
Most modules will come with a few new types of content, either a new Content Block and one or more Portlets, which are designed to display those Content Blocks in interesting ways. To discover what new contents have been added, you can look at the Content Library for a new group (like ‘News’) or add a new Portlet, which will list all available portlets in the system.