comments

An article by Gaspard Bucher

enter into the list of comments context

  1. action
  2. ajax
  3. API
  4. classes
  5. common attributes
  6. conditions
  7. context
    1. ancestors
    2. author
    3. comments
    4. comments_to_publish
    5. content_for_layout
    6. context
    7. count
    8. data
    9. each
    10. each_group
    11. expand_with
    12. find
    13. group
    14. node
    15. project
    16. proposed
    17. query
    18. query_errors
    19. query_parse
    20. real_project
    21. real_section
    22. redactions
    23. replies
    24. search_results
    25. section
    26. tags
    27. to_publish
    28. unknown
    29. user
    30. visitor
    31. visitor_node
  8. dates
  9. display
  10. forms
  11. i18n
  12. meta
  13. SQLiss
  14. urls

enter into the list of comments context

  • where filter clause
  • from sub query
  • ... see unknown for all options
see comments_count, replies
<ul do='comments'>
  <li do='each' name='com'><r:edit/><b do='[title]'/><p do='[text]'/>
    <ul do='replies' do='include' part='com'/>
  </li>
  <li do='add'/>
</ul>

<ul do='comments' order='created_at desc'>...</ul>

The example above shows an include tag used to produce recursion (replies of replies of replies).

To let us use the simple zafu code above, we had to implement some class agnosticism in zafu and the recursion thing, both of which were not really easy. So … enjoy.

The current implementation of CommentQuery does not support sub-queries because we have not yet found a way to get the correct discussion_id in the query.

attributes

Here is a list of attributes that a comment can display:

title, text, author_name, created_at, updated_at, status

The author_name attribute is special as it shows the name provided by an anonymous user or the fullname of the author’s contact.