Changeset 347

Show
Ignore:
Timestamp:
02/24/07 12:29:58 (2 years ago)
Author:
seancribbs
Message:

mental: [aggregation extension] Added documentation for the tags.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/mental/extensions/aggregation/app/models/aggregation_tags.rb

    r342 r347  
    22  include Radiant::Taggable 
    33   
     4  desc %{ 
     5    Aggregates the children of multiple URLs using the @urls@ attribute. 
     6    Useful for combining many different sections/categories into a single 
     7    feed or listing. 
     8     
     9    *Usage*: 
     10     
     11    <pre><code><r:aggregate urls="/section1; /section2; /section3"> ... </r:aggregate></code></pre> 
     12  } 
    413  tag "aggregate" do |tag| 
    514    raise "`urls' attribute required" unless tag.attr["urls"] 
     
    1423  end 
    1524   
     25  desc %{ 
     26    Renders the total count of children of the aggregated pages.  Accepts the 
     27    same options as @<r:children:each />@. 
     28 
     29    *Usage*: 
     30     
     31    <pre><code><r:aggregate urls="/section1; /section2; /section3"> 
     32      <r:children:count /> 
     33    </r:aggregate></code></pre> 
     34  }   
    1635  tag "aggregate:children:count" do |tag| 
    1736    options = aggregate_children(tag) 
    1837    Page.count(options) 
    1938  end 
    20    
     39  desc %{ 
     40    Renders the contained block for each child of the aggregated pages.  Accepts the 
     41    same options as the plain @<r:children:each />@. 
     42 
     43    *Usage*: 
     44     
     45    <pre><code><r:aggregate urls="/section1; /section2; /section3"> 
     46      <r:children:each> 
     47        ... 
     48      </r:children:each> 
     49    </r:aggregate></code></pre> 
     50  } 
    2151  tag "aggregate:children:each" do |tag| 
    2252    options = aggregate_children(tag) 
     
    3262  end 
    3363   
     64  desc %{ 
     65    Renders the first child of the aggregated pages.  Accepts the 
     66    same options as @<r:children:each />@. 
     67 
     68    *Usage*: 
     69     
     70    <pre><code><r:aggregate urls="/section1; /section2; /section3"> 
     71      <r:children:first> 
     72        ... 
     73      </r:children:first> 
     74    </r:aggregate></code></pre> 
     75  } 
    3476  tag "aggregate:children:first" do |tag| 
    3577    options = aggregate_children(tag) 
     
    4183  end 
    4284   
     85  desc %{ 
     86    Renders the last child of the aggregated pages.  Accepts the 
     87    same options as @<r:children:each />@. 
     88 
     89    *Usage*: 
     90     
     91    <pre><code><r:aggregate urls="/section1; /section2; /section3"> 
     92      <r:children:last> 
     93        ... 
     94      </r:children:last> 
     95    </r:aggregate></code></pre> 
     96  } 
    4397  tag "aggregate:children:last" do |tag| 
    4498    options = aggregate_children(tag)