0
votes

I have a views page which tracks posts created by users. Its having a field(comment_count) to show no of comments in a node. the field is working fine except its showing blank spaces in fields with no comments.

I am using the template file views-view-field--tracker--page--comment-count.tpl.php and copying the line <?php print $output;?> as suggested by views. but i have no idea how to modify the template output to ... replace the empty spaces with text such as 'no comments' or something similar. I would really appreciate if anyone can help me on this.

1

1 Answers

0
votes

There are more templates involved in View processing. Go to admin/build/views/, edit your view and see Theme: Information. There you'll get currently used templates, their brief descriptions and default code.

As for field template, there are some variables available:

  $view: The view object
  $field: The field handler object that can process the input
  $row: The raw SQL result that can be used
  $output: The processed output that will normally be used.