2

I built a Drupal 7 site using the Views module and I am using the "comment count" field.

If I choose the format plural checkbox, with a comment, it will output "1 comment", and when there are zero comments, 2 or more comments, it will output the number of comments followed by comments. If I want to output "no comments yet" when the comment count is 0, I can use the "No result behavior (Count the number 0 as empty)" option.

The problem is that the format plural option is not working together with the "No result behavior" option. When I use both of them, I get "0 comments" instead of "no comments yet."

How can I achieve my goal?

3

I managed to get this working by using the following settings for the Content: Comment count field:

  • Format plural checked
  • Singular form: @count comment
  • Plural form: @count comments

Under No results behavior:

  • No result text: no comments yet
  • Count the number 0 as empty checked
  • Hide if empty checked
  • Hide rewriting if empty checked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.