This article was peer reviewed by Fred Heath. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be!
Just another content management system? If that is the question running through your mind, wait until you get to the end of this post. I have been on the search for a Content Management System (CMS) built on Ruby on Rails but like WordPress. All the content management systems I have found are great in their different ways, but none matched this requirement until I found Camaleon CMS.
Welcome to Camaleon CMS
According to RailsCarma, “Camaleon CMS is an advanced and dynamic semantic personal publishing CMS based on Ruby on Rails. It allows you to manage your website from any place with internet connection. Modular, cost-effective and scalable website, Camaleon CMS is a feature-packed, established and remarkably well-coded powerful platform focused on aesthetics, web standards and usability.” It was built and is currently manainted by Owen Peredo Diaz.
- Multi Site.
- Multi Language: You can manage the contents of your site in several languages.
- Manage widgets to embed anywhere.
- Security: Multiple security measures are available to protect your site from various attacks.
- SEO & HTML5: Automatic sitemap generators, SEO Configuration, SEO for social media, and content customization for various devices.
- Easily customize the look of the site using themes.
Enough talk, let’s get busy!
Camaleon CMS requires ImageMagick to work. Installing it is pretty easy, open up your terminal and run the command below, depending on your operating system:
For Mac users (with Homebrew installed):
brew install imagemagick
For Ubuntu users:
sudo apt-get install imagemagick
Camaleon CMS requires Ruby on Rails 4.1+. To check the version of Rails running on your machine, open a terminal and enter the command:
rails -v => Rails 4.2.1
To install the latest Rails version, open up a terminal and enter:
gem install rails
That will install Rails and its dependencies. As of the time of this writing, the latest Rails version is 4.2.4. In this tutorial, we will learn how to build a blog using Camaleon CMS.
From your terminal create a new Rails project and navigate to its home directory:
rails new rubyblog cd rubyblog
Open the Gemfile using your text editor and add the Camaleon CMS gem:
Run bundle install:
Thanfully, Camaleon comes with some handy generators. Let’s use them to install the CMS. From your terminal type:
rails generate camaleon_cms:install
This will copy some basic templates and plugins into your project. You can follow the path shown on your terminal to see what was created.
From the terminal output, you’ll notice that something was added into the Gemfile. The
camaleon_cms gem has its own dependencies. Open the lib/Gemfile_camaleon file to view the gems. Go back to your Gemfile and you will see what was appended:
#################### Camaleon CMS include all gems for plugins and themes #################### require './lib/plugin_routes' instance_eval(PluginRoutes.draw_gems)
Install the gems and migrate the database:
bundle install rake db:migrate
Start your server (
rails s) and view the blog by going to
http://localhost:3000 in a browser.
General Settings and Customization
You will be presented with a page for quick setup. Enter the name of your blog and choose a theme. Three themes are provided, select one and hit submit.
Camaleon CMS presents a default username and password (
admin/admin) to login to the admin dashboard. We need to change this. Login to your dashboard. Click on the icon by the right hand side of the user image shown on the left side of your screen as indicated below.
Scroll down to the bottom of the page and select
Change Password. Enter your old password which should be
admin and a new password in the form displayed. Select
Process and a dialog box should pop up showing that your password has been updated.
From this panel, you can edit the user profile as needed. When you are done, log out and login to see if the password successfully changed. You can log out by clicking the icon at the top right corner of your screen, then select
Yes from the dialog box that pops up. If you changed the username from
admin, enter the new one and your new password to login to your dashboard.
Camaleon CMS allows you to add more users with different roles, such as Administrator, Client, Contributor, and Editor. This is easy to do. Click on Users by the left hand side of your dashboard. From the dropdown select Add User. In the panel that is shown, you can create a user after setting up the profile as you please:
You can also control the actions a user can perform by editing the actions of the Roles. To do this click on User Roles under Users by the left side of your dashboard. It is also possible to add and delete User Roles.
Changing Site Language
As mentioned above, one of the features of Camaleon CMS is the ability to manage site contents in various languages. Let us see how that is possible.
On the left side of your dashboard click on
Settings, from the drop-down select
Languages. On the next page, choose any language you want for your blog:
Posts are what you think of when you think of a blog. To create a post, on the left side of your dashboard select
Content > Post > Add New.
In the top field, insert a title. Write your post in the large area below the title. Use the formatting buttons to customize your post:
To add an image, place your cursor in the text where you’d like to put the image, and click Insert/edit image on the content toolbar as shown in the screenshot below:
In the dialog box that pops up, enter a link to the image in the
Source field or click on the
search icon by the side to upload the image.
If you clicked the search icon the Media Manager opens up for you to import the image into your post.
Click OK on the next box. You can always edit your image by clicking on Insert/edit image on your content toolbar.
To insert a Page Break, place your cursor on the place you want the break. On your content toolbar hover on Insert and select Page Break from the drop-down.
Creating New Page
Camaleon CMS comes with built-in support for creating pages. From your dashboard, click on
Pages by the left side of your screen. From the drop-down click on
Add New. You will be presented with a page that looks similar to what WordPress gives when you want to add new page. Enter the details into the text field and click on
Create Page. You can upload an image to your page by using the
Featured Image option shown on the right side of the screen. The configuration option allows you to choose if you want your page to be published immediately or not.
Categories are a convenient way to organize your posts. They give a lot of flexibility to show the posts you want, the way you want them.
To create new categories, click on
Content > Post > Categories. On the left side of the page, there is a tab that allows you to create categories. Fill in the category name, slug (will be used in the category URLs), description (this is optional) and click on the Submit button.
Assigning Posts to Categories
Once you have the category structure created, you can add posts to categories. Create a new post by clicking on
Content > Post > Add New and simply select the category for the post.
Creating a Menu
Menus are a list of common links, usually displayed as the main navigation for your site.
To create a custom menu, click on
Appearance, from the drop-down options click on
Menus. By default a menu is created for you: Main Menu. To change the name of the Main Menu, enter your preferred name into the text box and click on Update Menu.
It is possible to add pages, posts, categories, tags, external links to your menu. First, you must have created and published the item. In the above image, notice the tabs for Posts, Categories, and Tabs. When you want to add one to the menu:
- Select the section (categories, pages, post, tags, external links) you want to add.
- Tick the box by the left side.
- Click on Add to Menu.
- Click on Update Menu.
Deploying to Heroku
Let us deploy our blog to Heroku. Add the following to your Gemfile:
group :production do gem 'pg', '~> 0.18.3' gem 'rails_12factor', '~> 0.0.3' gem 'puma', '~> 2.14.0' end
Create a file in your config directory for Puma and paste the configuration below into it:
workers Integer(ENV['WEB_CONCURRENCY'] || 2) threads_count = Integer(ENV['MAX_THREADS'] || 5) threads threads_count, threads_count preload_app! rackup DefaultRackup port ENV['PORT'] || 3000 environment ENV['RACK_ENV'] || 'development' on_worker_boot do # Worker specific setup for Rails 4.1+ # See: https://devcenter.heroku.com/articles/ # deploying-rails-applications-with-the-puma-web-server#on-worker-boot ActiveRecord::Base.establish_connection end
In order to publish to Heroku, we need our site to be under git source control. Initialize the repository and add the files:
git init git add . git commit -m "initial commit"
If you do not have an account on Heroku yet, go and create one. Then check to see if your system already has the Heroku command-line client installed:
If not, you can get the Heroku toolbelt here. Once you have installed the toolbelt, login and add your SSH key:
heroku login heroku keys:add
Next, use the
heroku create command to create an app on Heroku:
Deploy the application by pushing the master branch to Heroku:
git push heroku master
Finally run database migration:
heroku run db:migrate
username: admin password: admin
Your app should be live now.
The world of Rails has been home to several CMS frameworks over time. Camaleon CMS is a solid addition, with its plugin framework and themes, it can do just about whatever you did. Today, I showed you how to setup a simple, but functional, blog using Camaleon CMS. Your feedback is welcome. Thanks for staying with me till the end :)
Kingsley Silas is a web developer from Nigeria. He has a hunger for acquiring new knowledge in every aspect he finds interesting.