Comments (19)
So does this code display a running total of the count?
{% do craft.entryCount.increment(entry.id) %}
{{ craft.entryCount.count(entry.id) }}
If it does, but nothing appears in the control panel, then maybe reinstall the plugin as something must not have worked in the initial install.
from craft-entry-count.
Yep, it does... I have it showing the running count for a set of entries as I view them.
Uninstall/reinstall and still the same behaviour.
from craft-entry-count.
The plugin uses the ElementQuery::EVENT_BEFORE_PREPARE
event. Do you have any custom modules/plugins installed that might be interfering with this?
You can also try this code in a template to see if any counted entries are returned.
{{ craft.entryCount.countedEntries.count() }} entries counted
Can you also check that the entrycount
datbase table is being populated?
from craft-entry-count.
The plugin uses the ElementQuery::EVENT_BEFORE_PREPARE event. Do you have any custom modules/plugins installed that might be interfering with this?
I'm not certain... we don't have any custom plugins we've written doing that but I'm not certain about other third party plugins. I did a quick search for the string EVENT_BEFORE_PREPARE
and got nothing so probably not.
{{ craft.entryCount.countedEntries.count() }} entries counted
When I do this, I get this error:
Neither the property "countedEntries" nor one of the methods "countedEntries()", "getcountedEntries()"/"iscountedEntries()"/"hascountedEntries()" or "__call()" exist and have public access in class "putyourlightson\entrycount\variables\EntryCountVariable".
Can you also check that the entrycount datbase table is being populated?
Yes, it appears to be populating correctly with the correct entry id and corresponding counts.
from craft-entry-count.
Hmm, strange, what about this?
{{ craft.entryCount.getCountedEntries().all()|length }} entries counted
from craft-entry-count.
Similar error:
Neither the property "getCountedEntries" nor one of the methods "getCountedEntries()", "getgetCountedEntries()"/"isgetCountedEntries()"/"hasgetCountedEntries()" or "__call()" exist and have public access in class "putyourlightson\entrycount\variables\EntryCountVariable".
from craft-entry-count.
Sounds like there must be a problem with your installed version. Can you remove the plugin files completely and reinstall?
from craft-entry-count.
I did uninstall it and reinstall it before via the cp. Is there something more I can do after uninstalling? ie. Are the plugin files still there to delete manually (I've never checked before)?
from craft-entry-count.
There’s an option to “remove” the plugin after uninstalling in the CP which will remove the files too. Otherwise you can use composer remove
as well.
from craft-entry-count.
Thanks Ben but still the same behaviour after removing and installing again.
I'm not a plugin developer so this comes a bit more from a layman's perspective but when I look at your plugin files, I can't even find a method for getCountedEntries
or countedEntries
... so maybe I'm missing something but I don't understand why you asked me to try those? Are you saying those methods exist but for some reason my installed files are missing them?
from craft-entry-count.
Apologies Mike, I was referencing a different version of the plugin. The method is called getEntries
in version 2.0.2, so this is the code:
{{ craft.entryCount.getEntries().count() }} entries counted
from craft-entry-count.
Ok, so that works and returns the expected result... as does this in a front end template:
{% set entries = craft.entryCount.entries.all() %}
But that returns nothing (ie. an empty array) when it is called in your cp template at craft/vendor/putyourlightson/craft-entry-count/src/templates/index.html
from craft-entry-count.
I'm getting this as well. Not showing up in the backend. I'm running the latest version of craft.
from craft-entry-count.
Do you have a multi-site setup? Could it be that the front-end site that it is working on is not the primary site?
from craft-entry-count.
No multi-site setup here. I did a fresh install of the plugin then I even did a fresh install of craft cms, unfortunately still getting the same thing.
from craft-entry-count.
Mine is a multi - and yes, it is on a secondary site... but in light of @SweetPoStayPro's non-multi, I guess that's not the issue? I could try testing on the primary... ok, just tested it. I get results on primary site entries in the CP - but not the secondary.
from craft-entry-count.
@Coalescent Ok so the issue is multi-site, I'll see if I can release a fix for this soon, thanks for sticking with it!
@SweetPoStayPro Can you please provide some more info and show your code?
from craft-entry-count.
Same to you Ben and thanks for providing a fix!
from craft-entry-count.
Released a fix in v2.0.3, however note that the plugin has limited multi-site compatibility, as it is intended for educational purposes. For anything more complex, check out the View Count plugin.
from craft-entry-count.
Related Issues (20)
- Craft 3 support HOT 2
- Control Panel Viewing slow/unresponsive with lots of database rows HOT 4
- No entries counted HOT 3
- Ordering by Entry Count HOT 3
- Entry Count with the {% paginate %} tag HOT 3
- I have added the plugin in my craft2 cms system and it doesn't show in plugin panel HOT 1
- How to update count from another app (mobile) HOT 3
- Wrong entry count displayed with multiple sites HOT 1
- Sort entries by views with Elements API? HOT 1
- How to access getCount function in Elements API HOT 2
- Plugin produces no results HOT 1
- How can I add a entry count if entries don’t have URLs? HOT 1
- How I can get the aggregate sum of all entries count in front end HOT 1
- New to Craft - Where Do HOT 2
- Better support for multi-site setups HOT 1
- CP only shows enabled entries HOT 1
- How can I exclude one or more entries from the entries output? HOT 1
- Craft CMS 4 HOT 2
- $dateCreated must not be accessed before initialization HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-entry-count.