Number Of Comments Within list_articles
  • On a section page, I am using list_articles to show the most recent articles in a given section. As each article is listed, I would like to include how many comments have been made to that article. I was wondering if I was just missing some parameter, or will I need to write code to pull in the comment number?

    Thanks in advance for any insight.
  • 1 Comment sorted by
  • Vote Up0Vote Down Mugur RusMugur Rus
    Posts: 132Member
    From the manual:
    http://en.flossmanuals.net/CampSite/TemplateObjects

    "Comments related properties/functions:

    - comments_enabled: true if comments were enabled for the article
    publication, article type and the current article
    - comments_locked: true if comments were locked (meaning they can be
    listed but no new comments can be posted)
    - comment_count: returns the number of the comments posted to the article
    and approved"

    $campsite->article->comment_count

    Mugur Rus
    Senior Developer, Sourcefabric
    mugur.rus@sourcefabric.org

    RO +40 (0)720 528408
    Turturicii 3/24, 400365 Cluj-Napoca, Romania

    http://www.sourcefabric.org


    On Sat, May 15, 2010 at 6:41 AM, Lee M. Childress <
    campsite-support@lists.sourcefabric.org> wrote:

    > On a section page, I am using list_articles to show the most recent
    > articles in a given section. As each article is listed, I would like to
    > include how many comments have been made to that article. I was wondering if
    > I was just missing some parameter, or will I need to write code to pull in
    > the comment number?
    >
    > Thanks in advance for any insight.
    >