Day Two with adva-cms
Post comments: View Comments
Previously, we looked into installing a new adva-cms run website and customizing the look and feel. Today I will go a bit deeper into the extended functionality that is available with this CMS. The documentation for this project is spread out in multiple places. Some of it can be find on the main website, others in the README file and some at the GitHub wiki pages. And even if you go through all those sources, the documentation still feels incomplete. Regardless, I will attempt to look into the extra functionality available to us.
Remember that last time I did install all of the engines and plugins available by executing the following:
rake adva:install:all
rake adva:assets:install
So they are all available to us, what is left to do is enable the ones that require extra steps to be enabled and then find out where in the admin interface to go to start working with them. adva-cms claims to provide the functionality of creating multiple sites. But if you were following along with what we did last time you would notice that this option was not available to us. That is because you have to explicitly specify that you want this enabled. To do so, create a new initializer file in your application:
`-root_directory
`-app
`-config
`-initializers
`-...
`-adva_init.rb
You can name that file whatever you want, I named it ‘adva_init.rb’ and that is where I would add any configuration code related to the adva-cms plugins. In that file add the following lines:
# adva_init.rb
ActionController::Dispatcher.to_prepare do
Site.multi_sites_enabled = true
end
Those lines will enable the ability of multiple sites for your project. You will notice a new tab being added to your admin panel. Make sure you have restarted your server after editing the initializer file.
Navigating to the “Sites” tab will display the list of all the sites you have created,
and gives the ability to create new ones.
So lets go ahead and create a new site with the following settings:
The important thing to notice is the host name field. Since we are working locally and we want to have both sites running at the same time, we have use a different port number. For this case I went with 3001. Now, in the terminal, go to your project directory and execute this line:
./script/server -p 3001
This will start another server running on port 3001. Using your web browser, navigating to http://localhost:3001/ will take you to the newly created site.
Notice that the second site we have created does not inherit the theme. Each site you create is totally independent and does not share settings with your other sites. Some people might want their sites to share themes, but with the ability to export and import themes the process is very easy and simple.
So we have now added the ability to create multiple sites using the adva-cms. Why not also add a WYSIWYG editor? To accomplish that, the idea is basically the same as what we did previously. One of the plugins that we have installed is the FCKeditor plugin. We just need to enable it by adding the following line to our initializer file and restarting the server:
# adva_init.rb
Fckeditor.load!
And voila:
If you have been following along with the previous posts, you know that the demo site I build with each of these CMSes is a conference site. Part of every conference website are events and a calendar. So lets create some events. The first you need to do is create a new section for your site and specify the type to be “Calendar”. Once you’re done you’ll be redirected to the “Events” page for that section. The list will start off empty. Click on the “New” button to create a new event. You should then see the following form.
Fill in the form and you’ll have your first event created. If you navigate to the calendar page (“/calendar”) you will see your events listed there along with a search form and a monthly calendar.
That’s pretty much it for events. Lets also take a look at creating photo albums. The process is pretty much the same. Create a new section of type “Album”, then under the “Photos” tab in the admin UI upload your images. If you want to group the pictures in photo albums or sets, create a new set and then select the checkbox corresponding to the set you want your picture to be published under.
You can view your pictures by going to the album page (“/album”) as well as your sets.
The is the same for the other content types available such as Wikis, Forums and of course Blogs. adva-cms does provide a bunch of good stuff out of the box. It is a CMS that is supposed to extend your custom Rails app and give you the tools you need to create typical content such as static pages, blogs, etc. With this note, I conclude Day Two with adva-cms.









