Statistics

A nice thing about PublicSquare is the ability to show off your community’s statistics. Here’s a bit of liquid to pull up some commonly used statistics.

Most commented upon

statistics screenshot
Most commented shows people what’s hot, what’s contraversial. A great way to get more discussion flowing!
This code lists the stories that have the most comments. You don’t have to use tables.

 {% if current_site.most_commented != empty %}
<h4>Most-commented Stories (past 60 days)</h4>
<table class="SBTable">
<tr>
<th class="SBTableHead">Title</th>
<th class="SBTableHead headRight">Comments</th>
</tr> {% for content in current_site.most_commented %}
<tr>
<td class="SBTableCell">
<a href="{{ content.url }}">{{ content.title | truncate: 25 }}</a>
</td>
<td class="cellRight">{{ content.recent_comments_count }}</td>
</tr> {% endfor %}
</table> {% endif %}

Highest Rated

statistics screenshotEveryone wants to know what’s the best—let them find those stories easily!

  {% if current_site.highest_rated_stories != empty %}
<h4>Highest-rated Stories</h4>
<div class="SBCopy">
<table class="SBTable">
<tr>
<th class="SBTableHead">Story</th>
<th class="SBTableHead">Rating</th>
</tr> {% for story in current_site.highest_rated_stories %}
<tr>
<td class="SBTableCell"><a href="{{ story.url }}">{{ story.title | truncate: 30 }}</a>
</td>
<td class="cellCenter" title="Based on {{ story.ratings_count | pluralize: "vote" }}"> {% for step in story.rating_steps %}{% if step.on %}
<img src="{{ 'dot-orange.gif' | asset_url}}" class="RatingSolid" alt="*" /> {% else %}
<img src="{{ 'dot-white.gif' | asset_url }}" class="RatingEmpty" alt=" " /> {% endif %} {% endfor %}
</td>
</tr> {% endfor %}
</table> {% endif %}

Most Active Authors


statistics screenshotThis can be useful if you have a group of regular authors, to spur a little competition, keep people writing…

  
<div class="SBHead"><h4>Most Active Authors</h4>
<div class="SBCopy">
<table class="SBTable">
<tr>
<th class="SBTableHead">Author</th>
<th class="SBTableHead headRight">Stories</th>
</tr> {% for user in current_site.most_active_authors %}
<tr>
<td class="SBTableCell">{{ user.link }}</td>
<td class="cellRight">{{ user.stories_count }}</td>
</tr> {% endfor %}
</table>

Most Active Contributors

statistics screenshotYou can call them commenters, or community members, but you want to reward the folks who make your community work with a little shout-out!


<div class="SBHead"><h4>Most Active Commenters</h4>
<div class="SBCopy">
<table class="SBTable">
<tr>
<th class="SBTableHead">Name</th>
<th class="SBTableHead headRight">Comments</th>
</tr> {% for user in current_site.most_active_commenters %}
<tr>
<td class="SBTableCell">{{ user.link }}</td>
<td class="cellRight">{{ user.comments_count }}</td>
</tr> {% endfor %}
</table>

More tips soon!

Rate This Story

Register or log in to rate
Average rating:

Talk about Statistics

Register or log in to comment