browsermedia/browsercms — Issue #462: Feature: Filtered Content Types from Content Library
Author: crh3675
Created: 2012-01-11 14:36:55+00:00
State: open

A nice feature would be to have the ability to define a method or use some manner to add filters to the left-hand the content type lists.

Let's say you have a content block called "News" and "Featured News" is simply a "News" content block with a flag set for being featured. As well, "Recent News" is just a scope of the model that lists everything up to today. It would be nice to have the ability to add something to the model like:

def self.display_filters
[
{ :label => 'Featured', :conditions => ['featured = true']},
{ :label => 'Recent News', :conditions => ['date <= ?',Time.now]}
]
end

Then, these would show up below the regular content items in the content library menu with the specified label:

| News
| News
| Featured
| Recent News

A route could be created such as:

/cms/news/filtered/:filter_name

And when a filter is chosen from the content library list, a :scope or lambda function can be executed to return only those results.