putyourlightson / craft-entry-count

Counts and displays the number of times that an entry has been viewed in Craft CMS.
MIT License
47 stars 19 forks source link

Better support for multi-site setups #28

Closed martijnckx closed 3 years ago

martijnckx commented 4 years ago

My website is running in five languages. Your plugin counts every entry view (in any language/site) for each entry variation in each site. When I want to sort my entries on view count (which I suppose your plugin is mainly intended for), I should be able to get only the entries for my current site. This can be achieved by changing line 80 of EntryCountService.php to ->site(Craft::$app->getSites()->currentSite) (instead of '*' as argument to the function). This is also more in line with your control panel view: it counts every view as a view for each site, but displays all sites (so I now have 5 identical lines on my control panel view of your plugin). I will create a pull request for this fix when I have more time later, if you don't find the time to implement this fix yourself.

bencroker commented 3 years ago

Thanks for the suggestion but there are no plans to add new features to this plugin, which is primarily for educational purposes. If you need new features then please consider using the View Count plugin which is commercially supported.