Yes I want generate the links of pagination for my "Bookshelf"
extension in a radiant page with a custom tag like this
"<r:books:paginate />" that work like paginating_links() in a standard
rails rhtml view.
This is the code of bookshelf_tags.rb:
module BookshelfTags
include Radiant::Taggable
tag 'books' do |tag|
tag.expand
end
tag 'books:each' do |tag|
result = []
Book.find(:all, :page => { :start => 1, :current => 2, :size => 6
}).each do |book|
tag.locals.book = book
result << tag.expand
end
result
end
tag 'books:each:book' do |tag|
book = tag.locals.book
%{<h3>#{book.title}</h3>
<p><strong>#{book.sub_title}</strong></p><p>pub year: #{book.pub_year}
- data form year: #{book.data_from_year} - to year:
#{book.data_to_year}</p>}
end
tag 'books:paginate' do |tag|
book = tag.locals.book
%{??????????}
end
end
And this is the code that I've used in my library page:
<r:books:each>
<r:book /><br />
</r:books:each>
<r:books:paginate />
Mariano
On Jan 21, 2008 3:40 PM, Sean Cribbs <[EMAIL PROTECTED]> wrote:
> The only case where you would want to do that is if you wanted to
> generate the links inside a page (not a regular view). Is that what
> you're trying to do? If not, just use the helper as-is in your views.
>
> Sean
>
>
> Mariano Viola wrote:
> > Hi all,
> > I've created an extension that use the rails "paginating find" plugin
> > "http://cardboardrocket.com/pages/paginating_find" and it work well on
> > the controller side.
> > But at this point can I create a radius tag that wrap the
> > paginating_links() method exposed from the helper (already activated
> > in my extension) that generate automatically the pagination?
> >
> > Thanks,
> > Mariano
> > _______________________________________________
> > Radiant mailing list
> > Post: [email protected]
> > Search: http://radiantcms.org/mailing-list/search/
> > Site: http://lists.radiantcms.org/mailman/listinfo/radiant
> >
> >
>
> _______________________________________________
> Radiant mailing list
> Post: [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant