The code above does not work.  The correct one is this:

<r:erb>
    <%  page = tag.locals.page
        parent = page.parent
        siblings = parent.children
        siblings.each do |sibling|
            if sibling != page
    %>
                <a href="<%= sibling.url %>"> <%= sibling.slug %> </a>
    <%      end
        end
    %>
</r:erb>

     There is a bug (feature?) in the current version of the back door
extension that prevents the expansion of Radius tags enclosed inside loops
in <erb> tags.  So putting a <r:link> inside the 'if' above won't work as
expected.  I will take a look to this and update the extension.

     The solution given by Sean is much cleaner.

     One thing i miss from Radiant is an easy way to make it "more
programmable" without resorting to extensions or to ugly code inside
<ruby>/<erb> tags.  Maybe it's time for a revamp of the back door
extension...

     /AITOR

On 9/8/07, Aitor Garay-Romero <[EMAIL PROTECTED]> wrote:
>
>
>     Back door extension to the rescue:
>
> <r:erb>
>     <%  page = tags.locals.page
>         parent = page.parent
>         siblings = parent.locals.page.children
>         siblings.each do |sibling|
>             if sibling != page
>     %>
>                 <r:link />
>     <%      end
>         end
>     %>
> </r:erb>
>
>      I did not test the code above, so beware!
>
>      /AITOR
>
> On 9/7/07, Andrea Otto <[EMAIL PROTECTED]> wrote:
> >
> > Thanks Aitor!
> >
> >
> > I understood why it didn't work! But <r:navigation/> has the same
> > problem: I can't build url list with radiant's tag...
> >
> > I think there's no solution for this issue...
> >
> >
> > --
> > Posted via http://www.ruby-forum.com/.
> > _______________________________________________
> > 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

Reply via email to