[Radiant] Next and Previous Articles

Keith Bingman keith at keithbingman.com
Wed Aug 23 02:04:34 CDT 2006


John,

I am having a few problems with this. First of all, 'next' is a  
reserved word. Changed that to 'next_link', but I am still getting a  
nil object for siblings. For some reason it is not finding any. This  
is with Radiant 0.5.2, any help appreiciated.

Keith Bingman

On Aug 22, 2006, at 10:46 PM, John W. Long wrote:

>     tag "next" do |tag|
>       current = tag.locals.page
>       by = tag.attr['by'] || 'title'
>       siblings = current.siblings.sort_by { |page| page.attributes 
> [by] }
>       index = siblings.index(current)
>       next = siblings[index + 1]
>       if next
>         tag.locals.page = next
>         tag.expand
>       end
>     end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20060823/1a58740d/attachment.html


More information about the Radiant mailing list