Questions tagged [count]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
64 views

Count entries with condition

I would like to count comments that belong to a certain entry (product). I have this so far: {% set comments = craft.entries().section('productcomments').all() %} {% set counter = 0 %} {% for ...
1
vote
1answer
33 views

How to count ad impressions

We're adding advertising to our Craft site. The ads come from our business members and are displayed randomly with article pages, based on tags and categories. All that is working fine. The question ...
2
votes
1answer
35 views

Get count of new entries since last visit

I'm relatively new to craft, but thanks to this board I am making great progress :-) But here is my first question, which is not answered in here: I would like to get the count of entries of a ...
1
vote
1answer
72 views

Entry Count plugin performance / template optimisation

I'm using Ben Croker's Entry Count plugin in my News channel but have noticed a huge performance hit, I know its probably down to how I am loading the entries in to my template so I am looking for ...
1
vote
1answer
2k views

loop.index is not returning correct number inside nested loop with inline if conditional

I'm getting incorrect loop.index results with the following code. It returns "1" for each entry returned. Is there a different way this needs to be written? {% for order in orders %} {% for ...
1
vote
1answer
419 views

Count table field values in certain section

I would like to know, how many values are saved in the table field called "artikelnummer" with the field name "artikel". The section is called "bikes". I tried: {% set entries = craft.entries.section(...
1
vote
1answer
275 views

How to display number of entries for a tag and not display if no entries?

I want to be able to display the number of entries that have a tag. Like: Fruit (9) Vegetables (4) I also want to avoid displaying any tags without any related entries. My code right now looks like ...
2
votes
1answer
410 views

Entry Count plugin

I'm trying to get the most popular entries of my site in a certain time period, for example 24h, based on the amount of views (clicks) it gets. I'm using the entry count plugin to do the counting but ...
3
votes
1answer
105 views

How to add a unique number for each reiteration and render it multiple times?

I am working on a testimonial slider and each slide is wrapped in an <li> tag. The JS looks for a similar id number, one for each layer of the slide, in this case I need to change the 1 in the ...
1
vote
1answer
511 views

Get the current structure entry's order

How can I get the number of a current entry in a structure? In other words, I'm getting the total number of entries like so: {% set count = craft.entries.section('projects').total() %} <h1>{{ ...
1
vote
2answers
187 views

Count users, not enough memory error

Hi I have like 2000 users in my system. I would like to get a count of the active ones, so I did it like this: {{craft.users.group('member').count()}} but this returns the count with the limit of ...
2
votes
2answers
334 views

Reverse count with paginated entries?

I have this loop {% paginate craft.entries.section('sermons').limit('10') as pageInfo, entries %} {% for sermon in entries %} ... {{ loop.revindex }} ... {% ...