0.0
Low commit activity in last 3 years
No release in over a year
Chronological Archives Engine for ComfortableMexicanSofa
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

ComfyArchive

ComfyArchive is a management engine for chronologically & categorically archived sections for Comfortable Mexican Sofa 2.x. You can select one or more Comfortable Mexican Sofa pages to act as an index for child pages, which will then be organized both cronologically, by year and month, and by category.

Gem Version

Dependencies

Make sure that you have ComfortableMexicanSofa installed first.

Installation

  1. Add gem definition to your Gemfile:

    gem "comfy_archive", "~> 0.3.0"

  2. From your Rails project's root run:

    bundle install rails generate comfy:archive rake db:migrate

  3. Add the following lines to your config/routes.rb file, after the "comfy_route :cms_admin" line and before the "comfy_route :cms" line:

    comfy_route :archive_admin comfy_route :archive

  4. You should also find view templates in your /app/views/comfy/archive folder. Feel free to adjust them as you see fit

Configuration

  1. Add a datetime tag to the layout used by any page which will be ordered chronologically under an index page, then set the field to a valid date & time in the pages themselves

  2. Add a new Archive Index, selecting the parent page (Important: can not be the root page!) which will act as an index for child pages and enter the name of the datetime tag you created in Step 1

  3. Optionally, create a config/initializers/comfy_archive.rb file to override default configuration options

Architecture

  • ComfyArchive: Rails Engine which manages configuration, adds scopes & associations to Comfy::Cms::Site & Comfy::Cms::Page models, and adds route matching methods
  • Comfy::ArchiveHelper: Helper methods for generating links to chronological & category archive pages
  • Comfy::Archive::Index: A model which represents pages which will become chronological archive pages, it has a Comfy::Cms::Page association and also the name of the page's datetime fragment to use for chronological ordering
  • Comfy::Admin::Archive::IndicesController: A Comfortable Mexican Sofa admin controller for managing Comfy::Archive::Index models
  • Comfy::Archive::IndexController: A controller for rendering Comfy::Archive::Index pages, plus chronological & categorical archive pages

Copyright (c) 2019-2022 Discovery Map International, Inc.