Sha256: a44b67a102162317a19450779422c3254bed56d020a0671bebb7f63c46f74b2d

Contents?: true

Size: 997 Bytes

Versions: 11

Compression:

Stored size: 997 Bytes

Contents

class ArchiveMonthIndexPage < Page
  
  def allowed_children
    []
  end
  
  description %{
    To create a month index for an archive, create a child page for the
    archive and assign the "Archive Month Index" page type to it.
    
    A month index page makes following tags available to you:
    
    <r:archive:children>...</r:archive:children>
      Grants access to a subset of the children of the archive page
      that match the specific year which the index page is rendering.
  }
  
  include ArchiveIndexTagsAndMethods
  desc %{
      Grants access to a subset of the children of the archive page
      that match the specific month which the index page is rendering.
      
      *Usage*:
       <pre><code><r:archive:children>...</r:archive:children></code></pre>
  }
  tag "archive:children" do |tag|
    year, month = $1, $2 if request_uri =~ %r{/(\d{4})/(\d{2})/?$}
    tag.locals.children = ArchiveFinder.month_finder(parent.children, year, month)
    tag.expand
  end
  
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
radiant-1.0.0 ruby-debug/ruby/1.8/gems/radiant-archive-extension-1.0.7/app/models/archive_month_index_page.rb
radiant-archive-extension-1.0.7 app/models/archive_month_index_page.rb
radiant-archive-extension-1.0.6 app/models/archive_month_index_page.rb
radiant-archive-extension-1.0.5 app/models/archive_month_index_page.rb
radiant-archive-extension-1.0.4 app/models/archive_month_index_page.rb
radiant-archive-extension-1.0.3 app/models/archive_month_index_page.rb
radiant-archive-extension-1.0.2 app/models/archive_month_index_page.rb
radiant-archive-extension-1.0.1 app/models/archive_month_index_page.rb
radiant-archive-extension-1.0.0 app/models/archive_month_index_page.rb
radiant-1.0.0.rc2 vendor/extensions/archive/app/models/archive_month_index_page.rb
radiant-1.0.0.rc1 vendor/extensions/archive/app/models/archive_month_index_page.rb