in reply to message board thread quandary
Ok, so i've waded through the replies and decided that I'll also need to do some template fiddling.
I'll need a nested loop to retrieve the child's replies, but i'm not sure how to determine in Template::Toolkit whether a reply has a reply or not.
Some pseudo code:
<!-- REPLIES START --> <table> [% FOREACH reply IN replies -%] <tr> <td/> <ul> <li><h2>[% reply.blog_title %]</h2> <p>by <a href="[% Catalyst.uri_for('/users/view/')_ reply.blog_a +uthor %]">[% reply.blog_author %]</a> on <em>[% reply.blog_date %]</e +m> , is a reply: [% reply.blog_is_reply %], is a draft: is a draft: [ +% reply.blog_is_draft %]</p> [% FILTER html_para %] [% reply.blog_text %] [% END %] <small> tags: [% FOREACH tag IN reply.blog_tags.split(',') %] <a href="[% Catalyst.uri_for('/blog/do_search')_'?q='_ tag %]"> +[% tag %]</a> , <p><a href="[% Catalyst.uri_for('/blog/reply/')_ reply.blog_id +%]">comment</a></p> </li> [% IF reply.has_reply %] <ul> <li>(display reply to reply stuff)</li> </ul> [% END %] </ul> [% END %] </small> </td> </tr> [% END %] </table> <!-- REPLIES END -->
|
|---|