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


_______________________________________________
Radiant mailing list
[email protected]
http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to