Closed (works as designed)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2018 at 11:35 UTC
Updated:
18 Apr 2022 at 02:23 UTC
Jump to comment: Most recent
Comments
Comment #2
socketwench commentedI don't believe you can actually use the flagcount plugin in a node template at all. The flagcount plugin requires the flag object, but it's not available in the node template. Furthermore, the flag field isn't a real field, so there's no way to access the flag object through the node or content variables.
It *is* available from the flag template though. It sounded like you added the flag template to your theme, did you add the flagcount code there?
Comment #3
zenimagine commentedOk so what is the sub module "count" for? How does it work ?
On my node I want to show:
- the flag link with
{{ content.flag_like_node }}OK- and below the number of flag on the node with ???
How to do this ?
Thank you
Comment #4
zenimagine commentedComment #5
zenimagine commentedComment #6
zenimagine commentedcan someone explain to me how the sub module works to conquer the flag? there is nothing in the documentation
Comment #7
zenimagine commentedPlease, who can explain to me how this module works? Can not get flag count in twig.
There is no documentation.
Comment #8
zenimagine commentedWhat is the purpose of this module and how does it work?
Comment #9
zenimagine commentedComment #10
zenimagine commentedComment #11
zenimagine commentedComment #12
tepelena commentedzenimagine
I am having the same issue. There is not much information on how to show total flag count. How did you do it?
Comment #13
PrajaktaN commentedfacing the same issue. please let me know how it works
Comment #14
chucksimply commentedSame here! Has anyone got the count working via this sub module? Or any other way?
Comment #15
chucksimply commentedSo for all still wondering...
{{ count }}MUST go in flag.html.twig along with{% set count = '[' ~ flagcount(flag, flaggable) ~ ']' %}. I couldn't get the flag count to work directly in the node.html.twig.Just know you can also specify the flag template to your specific flag if you need to narrow it down... something like flag--like-node.html.twig.
Hope this helps some.