Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

How would you make a view count?

Started by Muut Archive 11 years ago · 4 replies · 375 views
11 years ago

How would you keep track views on a page and display it to the user?

11 years ago

Take a look at the admin plugin, it's doing this already with a built in functionality called popularity. You can see the results in the dashboard.

11 years ago

Is there a simple way instead of writing a plugin?

11 years ago

No you will need a plugin to display the information. The hard work has already been done. If you have the Admin plugin installed, the data is tracked and stored as a simple json file.

You would still need a plugin to read that json file and do stuff with it. The page count for a particular page is not directly stored on or in the page itself.

Grav is meant to be simple and very fast, so it does not provide every possible feature, but it's also crazy flexible, so you can add this kind of functionality if you wish. Plugins are easy to write with a little PHP experience. Just look at the 60+ plugins out there on GitHub already.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1334 9 years ago
Archive · by Muut Archive, 9 years ago
2 925 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2939 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago