0.0
No commit activity in last 3 years
No release in over 3 years
Description of OrdinaryCms.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Ordinary CMS

This is simple CMS integrated into ActiveAdmin. It use mercury as wysiwyg html editor. This only works on MongoDB

Installation

Add the following to your Gemfile:

gem 'ordinary_cms'

Run install generator

rails g ordinary_cms:install

If you have installed ActiveAdmin, run:

rails g ordinary_cms:install --skip-activeadmin

Getting started

Create a new page

Go to ActivaAdmin control panel and select menu "Ordinary Cms Pages". Click to create bottom. You can create a page with an arbitrary number of content's section.

Override views

To override page's show view create file 'show.html.<haml/erb/slim>' in to 'views/ordinary_cms/pages'

To override show view of specific page create file '<page.name>.html.<haml/erb/slim>' in to 'views/ordinary_cms/pages'

Render content

To render editable page's content using following method:

@page.section('section_name').render

To render editable page's alias using following method:

@page.section('section_name').render :alias

Edit page's content

To edit page's content go to pages index page in active admin and click on link 'Edit content'. You will be redirected to mercury editor for the specific page.

Factories

OrdinaryCMS has factories for build pages by a scheme.

To create factory create following code to your seed.rb

OrdinaryCms::Factories::Page.create name: 'factory_name' sections: [{name: 'first, alias: 'First'}, {name: 'second, alias: 'second'} ...]

Run db:seed

Now you can select factory in select box on form for create page in ActiveAdmin. And when the page is to created it will be have sections with names 'first' and 'second'

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request