Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

caboose-cms

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caboose-cms

  • 1.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Caboose CMS

Caboose is a simple yet flexible and powerful content management system that runs on top of ruby on rails. It handles users, roles, permissions, and the login process. In addition, it handles content pages and their URLs. It has a layout system that allows a developer to easily customize the look and feel of each page.

  • Installation
  • Layouts
  • Plugins

Installation

Install the caboose-cms gem:

$ gem install caboose-cms

Create a new rails app configured to use Caboose:

$ caboose new my_caboose_app

Now go create a local MySQL database called my_caboose_app_development. Then let Caboose install the database:

$ cd my_caboose_app
$ rake caboose:db

That's it! To test it out, start your rails server:

$ rails server

And go check out http://localhost:3000

Layouts

Caboose already handles the page editing process, but you need to be able to control the layout for each of those pages. You do that with layouts. Caboose has a simple layout system. You control which layout each page uses. There are three options:

Default layout:

The layout that any page by default will use if any other layout options are not set. This layout resides in the layout_default.html.erb file.

Per page layout:

Just create a new layout called layout_<page_id>.html.erb.

Example: layout_37.html.erb

Per type layout:

If you need multiple pages to use a common layout, just create a layout with a name.

Examples: layout_about.html.erb, layout_listing.html.erb

For each layout, a few things must exist in the layout for it to work properly with Caboose. You must include the following:

  • CSS and CSRF in the head:

    <%= yield :css %>
    <%= csrf_meta_tags %>
    
  • The top nav login/control panel link:

    <%= render :partial => 'layouts/caboose/top_nav' %>
    
  • The top nav login/control panel link:

    <%= render :partial => 'layouts/caboose/top_nav' %>
    
  • The station and javascript in the footer:

    <%= render :partial => 'layouts/caboose/station' %>
    <%= yield :js %>
    

You have access to the @page object in the layout. Here's a bare-bones example of all the elements:

<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<%= yield :css %>
<%= csrf_meta_tags %>
</head>
<body;>
<%= render :partial => 'layouts/caboose/top_nav' %>

<h1><%= raw @page.title %></h1>
<%= raw @page.content %>  

<%= render :partial => 'layouts/caboose/station' %>
<%= yield :js %>
</body>
</html>

Plugins

To add new functionality to the Caboose station, extend the Caboose::CaboosePlugin object and override the methods you'd like to implement. The existing hooks are the following:

String page_content(String str)
Manipulate the page content before it's shown on the screen.
Array admin_nav(Array arr)
Add items to the navigation that appears in the Caboose station.

FAQs

Package last updated on 19 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc