The Entry Count Plugin was built specifically for the Craft Plugin Development video course by Mijingo, which has since been discontinued. The Getting Started with Craft Plugin Development course on CraftQuest is a good alternative.

It allows you to count and display the number of times an entry has been viewed in Craft CMS. The plugin is intended for educational purposes and can be freely used for simple use-cases. For anything more complex, use the View Count plugin.

License #

This plugin is licensed for free under the MIT License.

Requirements #

This plugin requires Craft CMS 3.0.0 or later, or 4.0.0 or later, or 5.0.0 or later.

Installation #

To install the plugin, search for Entry Count” in the Craft Plugin Store, or install manually using composer.

composer require putyourlightson/craft-entry-count

Twig Tags #

count(entry.id)

{% set count = craft.entryCount.count(entry.id) %}

Entry count: {{ count }}
First count: {{ count.dateCreated }}
Last count: {{ count.dateUpdated }}

entries

{% set entries = craft.entryCount.entries.all() %}

{% for entry in entries %}
    {% set count = craft.entryCount.count(entry.id) %}
    {{ entry.title }} ({{ count }} views)
{% endfor %}

increment(entry.id)

{% do craft.entryCount.increment(entry.id) %}

Have a suggestion to improve the docs? Create an issue with details, and we'll do our best to integrate your ideas.