Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorhaakon
     
    Hi,

    Seems like it's impossible to use partials recursivly, since they use the same variables inside the same scope.

    For example, in RoR you can do this:
    http://pastie.textmate.org/96686

    I want to list out a recursive tree of categories with partials.
    • CommentAuthorhaakon
     

    Or at least so it seems.. Because the template goes into an eternal loop with this code:

    Main file:

    <%= render 'category_partial', 200, :categories => categories %>
    

    Partals file category_partial.tpl:

    <ul class="category">
    {loop categories}
        <li><a href="#">{category.name}</a></li>
        <ul class="category">
        {?category.categories}
            <%= render 'category_partial', 200, :categories => category.categories %>
        {end}
        </ul>
    {end}
    

    Though the code generating the recursive comments is functioning fine.