Changes/Fixes to the Simple CMS Plugin
You can also view the tutorial. Or you can check out the demo.
We are continuously adding to and changing the Simple CMS Plugin so here is a little rundown of what has been changed so far:
Major Changes:
- I have updated to rails 2.0.2 so if you are using an older version you will need to change a line in each of the controllers.
- The acts_as_versioned plugin is now required for the revisions. I added this quite some time ago. I did change the rake task to install this plugin as well as the rest.
- You now have to pass a :prefix if you have one. This is to ensure that all content such as images, media, smiles, etc. work correctly. If your base path is a standard path then you do not need to worry about this.
For example: I was running 3 rails applications under one domain so it looked like this:my.domain.com /blog /forum /demo So I would call my Simple CMS content like this for blog:
- Now you can make content viewable and editable from multiple pages by passing :reusable => true. This defaults to false. Your label must be the same in each place you use it. This is very useful for layouts, such as header and footer.
*NOTE* If you already have content here and you change this variable you will lose all that content as it gives the content a new id and changes the params and how the content is called. For example if I have :reusable set to false and I have content there and I set :reusable to true then it creates content with a different id so I will not be able to use the old content until I change it back to false.
1 2 3 4 5 6 |
# Where it has: self.view_paths << File.join(File.dirname(__FILE__), '..', 'views') # Must be Changed to: self.template_root = File.join(File.dirname(__FILE__), '..', 'views') |
1 2 3 |
<%= render :simpleCMS => "MyBlog", :admin => true, :prefix => "/blog" %>
|
Minor Changes:
- When you click on a revision you are taken back up to the top of the page instead of having to scroll all the way down a list of 100 revisions, clicking on one, and then manually scrolling all the way back up to the top to see if you even picked the right revision
- I have added code highlighting and this requires the coderay plugin, which has been added to the rake simple_cms:install_dependencies, and a coderay stylesheet so you need to add that to your application layout. I have included it in the rake simple_cms:install
- I have also changed many things in the javascripts inside the tiny_mce editor so it would be safest just to use the rake tasks that are built in:
1 2 3 |
<%= stylesheet_link_tag "coderay" %>
|
1 2 3 4 |
rake simple_cms:uninstall rake simple_cms:install |
I have updated the tutorial with all the changes as well.
There is also a demo that you can use to play around with it and ask questions.