Jump to content

Photo

Stuck in an infinite loop

- - - - -

  • Please log in to reply
No replies to this topic

#1
Marked

Marked
  • Members
  • 164 posts
  • Joined: 21-May 10
  • LocationChch, NZ
  • Expertise:HTML, CSS, PHP, SQL

Why does this loop infinity?

 

I'm trying to build a nested comments system:

{% for comment in kushi_post_comments %}

{% include "kushi/post/comment" %}

{% endfor %}

Inside refinery/post/comment

   {% if comment.children %}
              
                        {% for comment in comment.children %}
                        {% include "kushi/post/comment" %}
                        {% endfor %}
                  
                {% endif %}

Therefore as long as a comment has data in the comments array, it will include itself. Eventually of course a child won't have any children itself. But this keeps looping :( Any ideas?






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users