Renamed helpers to correspond to renamed Controller classes.
[merb_radiant.git] / radiant_extensions_plugins / extensions / archive / app / models / .svn / text-base / archive_year_index_page.rb.svn-base
blobdb633f274f91f4fc983d3843c357540e38c7f5c6
1 class ArchiveYearIndexPage < Page
2   
3   description %{
4     To create a year index for an archive, create a child page for the
5     archive and assign the "Archive Year Index" page type to it.
6     
7     A year index page makes following tags available to you:
8     
9     <r:archive:children>...</r:archive:children>
10       Grants access to a subset of the children of the archive page
11       that match the specific year which the index page is rendering.
12   }
13   
14   include ArchiveIndexTagsAndMethods
15   desc %{
16       Grants access to a subset of the children of the archive page
17       that match the specific year which the index page is rendering.
18       
19       *Usage*:
20        <pre><code><r:archive:children>...</r:archive:children></code></pre>
21   }
22   tag "archive:children" do |tag|
23     year = $1 if request_uri =~ %r{/(\d{4})/?$}
24     tag.locals.children = ArchiveFinder.year_finder(parent.children, year)
25     tag.expand
26   end
27   
28 end