Module: Pageflow::NewsItemApi

Included in:
Pageflow
Defined in:
lib/pageflow/news_item_api.rb

Overview

Api for plugins to contribute news items for the news collection configured via ‘config.news`. Included in the Pageflow module to provide `news_item` class method.

Instance Method Summary collapse

Instance Method Details

#news_item(name, options) ⇒ Object

Add a item to the news collection configured via ‘Configuration#news`. Intended to be used with Krant (see github.com/codevise/krant). See Krant’s readme for details on the supported parameters.

Since:

  • 12.2



12
13
14
15
16
# File 'lib/pageflow/news_item_api.rb', line 12

def news_item(name, options)
  after_global_configure do |config|
    config.news.item(name, options) if config.news
  end
end