Ok, I think I have it here. Not as elegant as John's, but for some reason current.siblings returns an empty array. I simply found the page's parent and then the children, those are siblings, right? I am sure there is a better way to do this, but here is the code: tag "next_page" do |tag| current = tag.locals.page parent = tag.locals.page.parent by = tag.attr['by'] || 'title' siblings = parent.children.sort_by { |page| page.attributes[by] } index = siblings.index(current) next_page = siblings[index + 1] if next_page tag.locals.page = next_page tag.expand end end tag "prev_page" do |tag| current = tag.locals.page parent = tag.locals.page.parent by = tag.attr['by'] || 'title' siblings = parent.children.sort_by { |page| page.attributes[by] } index = siblings.index(current) prev_page = siblings[index - 1] if prev_page tag.locals.page = prev_page tag.expand end end Still has a few problems, like showing the last link on the first page, but these are easily overcome. Keith Bingman On Aug 23, 2006, at 9:04 AM, Keith Bingman wrote: John, |
_______________________________________________ Radiant mailing list Radiant@lists.radiantcms.org http://lists.radiantcms.org/mailman/listinfo/radiant