Questions tagged [flags]

Use it for the module implementing a flexible flagging system, completely customizable by the administrator users: the Flag module.

Filter by
Sorted by
Tagged with
4 votes
0 answers
446 views

Node access user reference

Main Modules: Node access user reference Node access node reference Flags Rules I'm trying to give access to a user that clicks on a Join Project flag link. I have a User Reference Field attached ...
0 votes
1 answer
24 views

For ECA, how can I create a flag that unpublishes a comment, using 'classic modeller'?

Rules and Rules_flag is not working well in Drupal 10.1, though I had a solution working in Drupal 9.5. The goal: a flag on each comment that unpublishes the comment, when a user clicks the flag. ...
0 votes
1 answer
577 views

How to use hook_node_insert to automatically flag nodes of a specific content type

All nodes of one content type in my project need to get automatically flagged (by the Flags module) when created. I'm aware that there is probably a way to accomplish this using Rules module, but I'm ...
0 votes
0 answers
45 views

How create a custom views contextual filter?

I've a site using Drupal 10.1.x. I need to implement the following requisites: Let the users choose their "most liked" nodes (bundle product). This bundle has a entity reference field to ...
2 votes
2 answers
471 views

How do I send notifications for followers of a group when group content is updated?

I want to build such functionality that allow the user to follow the other users, and when the followed person is updating the information, the follower can get notified for what they are doing. I ...
0 votes
1 answer
414 views

How can I build a "visitor history" using Flag/Rules?

I need to build a history for visitors so they can see which pages they've visited (ideally filtered by type). To do this, it seems that the correct combo is to use Flag module and then Rules. I'd ...
0 votes
1 answer
21 views

How to move on to the next profile page in views after flagging a profile within the view?

I created a view that current user can use to search/view user profiles. The view lists user profiles and shows one at a time. A profile page can be either flagged “Like” or “Pass” (dating website ...
1 vote
1 answer
770 views

Is there any way of removing (or unflagging) all of a user's flags?

I have a situation where a privileged user (role that is purchased) can flag content and receive email notifications to comments posted. When the role is expired, I need for them to stop receiving ...
3 votes
2 answers
418 views

How to add a 'flag link' in an email?

I want to add a 'flag link' in an email. I have an event content type, and every time a new event created, the users get an HTML Email. I have a flag that the users can flag this event if they want to ...
1 vote
3 answers
951 views

"[node:flag-vote-count]" displays the token name, not the number

I have a problem in the Flag module with the [node:flag-vote-count] token. I googled for a solution, but I couldn't find one. On my content page, the Flag module displays the token name (i.e. [node:...
1 vote
1 answer
452 views

Assigning a badge to a user using Flag, Badges and Rules

I am interested in assigning to user a Badge after he favorites 3 nodes. I want to do this with Flag, User badges and Rules. How can I do that?
1 vote
1 answer
821 views

How to count the number of comment and flag in a node?

I want to display on my node the number of comment and flag. What should I add to my TWIG to get this? How to count the number of comment and flag in a node? Here is an example :
3 votes
1 answer
1k views

Displaying Content Flagged by User Name with Flag Module

I'm using Drupal 7.38 with the Flag (v7.x-3.6) module, along with Views. I'm setting up a flag for content. My goal is to display a list of users whom are flagging content (along with aggregated ...
0 votes
1 answer
373 views

Add flag counter in views Module(Search API index)

I want to add flag counter of content in views field. Authenticated users can flag(bookmark) contents. I want to know how many users flaged a content, And I want to add this in views field(display the ...
0 votes
1 answer
445 views

Set node to flagged by default

I'm using flags on my site as a way of filtering content through views, when a user views a certain node content type, I have a rule setup which resets the value of my flag and sets it against that ...
0 votes
2 answers
540 views

How to create a view showing Users who have flagged AND are flagged by the current user

I'm trying to display a list of users who have flagged the current user, and are flagged by the current user. So a two-way flagging. I've tried using different relationships and arguments in views, ...
2 votes
4 answers
2k views

How to remove all roles from a user?

Users on my site generally have several roles. However, every once in awhile I get a spam user, and so I close that account by flagging it with a spam flag, which triggers a rule to block the account....
2 votes
2 answers
374 views

Is there a way to add non indexed fields to a search api view?

I’m wondering if it’s possible to add non-indexed fields to a search API indexed view? I want the standard flags fields to be available on the indexed search view. And I was thinking I could do this ...
2 votes
1 answer
858 views

View, flag, and followers

I have a user flag that is called "follow" and am trying to setup the following views in Drupal 8. I want to create 3 views for my website's user profile pages: A list of users flagged by a user (...
0 votes
0 answers
25 views

Send email immediately on subscribe?

I've looked through the Drupal 8 documentation for the Message Notify and the Message modules. They don't seem very complete, so I'm hoping to get additional info. I have several nodes that exist on a ...
0 votes
1 answer
78 views

Can a Rules action send an email to all users that have set a flag?

I've found some older Drupal 7 info on this, but not much for Drupal 8+ yet. What I want to do: Give users the ability to set a 'notify me' flag on nodes When a comment is added to the flagged node, ...
2 votes
3 answers
1k views

How to use the flag counter in a twig template of a node?

The version dev of the module "Flag" for "Drupal 8" has added a new sub module "Flag Count": https://www.drupal.org/project/flag/issues/2708291 I copied the code {% set count = '[' ~ flagcount(flag,...
0 votes
0 answers
28 views

Where to implement CSS previously implemented by CSS_editor now deprecated

Views with tables have a Flag that changes from Pending to Complete when the row is completed. The background of the entire row changes color depending upon the word. Working css_editor code (theme ...
1 vote
1 answer
60 views

How can I set a Rules action to unpublish a comment when a specific flag is set?

I'm attempting to create a flag that will unpublish a comment when the flag is set on that comment. I'm attempting to use Rules, Flag, and Rules Flag to achieve this. The comment type is default '...
3 votes
1 answer
257 views

How to show data of user that flagged a content(5 flag types or more)?

This is a followup question about this Old question I have 5 flag types for a content type. consider we have 5 flag types and we don't know how many flags our user used. I mean, the first user can ...
9 votes
2 answers
6k views

How can I flag content programmatically?

The Flag module is still in development for Drupal 8, but it's working nice. However, I didn't find how to add a flag programmatically; the API documentation seems to speak of the Drupal 7 version. ...
0 votes
2 answers
239 views

How to add Flag Link field to view based on Search Index?

So, I am building a faceted search view on my product display, but I cannot add the field for the Flag link. I can get fields that reference the User's who used a flag, but no relationship that I can ...
3 votes
1 answer
164 views

Custom AJAX Response not firing on Flag action

I'm trying to run custom javascript functions at the same time as people interact with certain flags on my site, I have followed this tutorial on how to respond to both Flag/Unflag actions, and this ...
0 votes
1 answer
26 views

How can I use Feeds to import flaggings with Flag 4.x?

I'm trying to set up the Feeds module to import flaggings with the Flag module on Drupal 9. However, I keep getting errors. What is the minimum necessary configuration to import flaggings?
1 vote
1 answer
56 views

Call to undefined function flag_get_flag() with Flag 4.x

I'm using the 8.x-4.0-beta3 release of the Flag module in a custom D9 module to flag a newly programmatically created node using a flag I created in the UI. $flag = flag_get_flag('new_call'); $flag-&...
1 vote
0 answers
105 views

Rules, Flags, Follower and New Content Notification

I am trying to setup a couple of rules. So far I have messed with rules some but since I am new, haven't had any success. This is what I am trying to achieve. Have created a user flag called FOLLOW. ...
0 votes
2 answers
251 views

How do you target a specific type of content?

I have the content type (node), article, page, recipe. The code below can be used to flag any type of content. How do you target a specific type of content ? For example I only want to flag the ...
1 vote
1 answer
24 views

How can I use a different dialog for flag removal than for setting the flag?

My project has a special flag with an entity reference field in it to nodes of a content type I'll call here "bucket." How it works: The flag "add to bucket" appears on nodes of ...
2 votes
2 answers
171 views

Revoke flag access to node author [closed]

I have a workflow system for my nodes, where one of the states is Disabled. There are some flags on those nodes as well; I'd like to to revoke access to flags to the node author when the workflow ...
0 votes
1 answer
18 views

Disabling Flag link access on view

I have a custom entity displayed in a view. If some field is of a certain value, the Flag link should not be available and replaced by some text. function my_module_preprocess_flag(&$vars){ $f = ...
1 vote
0 answers
24 views

Custom Flag not appearing in "Configure Relationship: Flags"

I am building a community site to link former co-workers. I have used the Flags module to allow users to tag locations/teams. I am trying to use views to now list all the users who have flagged a ...
0 votes
1 answer
382 views

How do I programmatically set a flag's custom entity reference field when programmatically setting the flag?

Some background: I'm new to Drupal 8/9 module building. I need a particular content type's nodes to be automatically flagged. I have this working using the code below. However, the flag involved also ...
1 vote
0 answers
37 views

Separate templates for flag links on views and node page

I have a flag called bookmark. The link to this flag is available on a View and the node page. On the view, I would like this flag link to only display as an icon as the link. On the node page, I ...
1 vote
2 answers
186 views

Adding fields to Flag Lists

I'm using the Flag Lists module to manage user wish lists. I need to add additional fields to the lists such as "body" I go to /admin/structure/flags/manage/fl_template/fields add the required fields, ...
1 vote
0 answers
27 views

Is it possible to create a view of a user's content and content they've flagged?

I'm trying to build a view that displays nodes authored by a user AND nodes flagged by the user (but are authored by other users). All the nodes are the same content type. I can create the two views ...
3 votes
0 answers
350 views

How to refresh/rebuild block without reloading the page?

I have a custom block which displays the number of events added to favorites(Flag module). I am using the TWIG template to display those results. I want to refresh the block contents right after the ...
1 vote
0 answers
92 views

How to reload flagging form via ajax?

My task is to ajaxify complex flag form (with additional fields). I need this because the default ajax flag does not dupport fiedls. I need to have the flagging form for create flag and then update it ...
0 votes
0 answers
22 views

Views: count flaggings per entity-referenced node

I have a flag called Collect. (Flag is individual, and enabled on multiple content types.) The flag has an entity reference field to a content type called Bucket. When users flag nodes, they go to a ...
0 votes
2 answers
384 views

How to create a taxonomy term from a webform

New to Webform. What I'm trying to do is build a somewhat simple site content-collecting tool using Webform. So users would 'collect' nodes by submitting forms on them. This appears to be easy to do. ...
2 votes
2 answers
1k views

Forcing flag to be unique

In Drupal 7, using Flags (and possibly Rules or another contrib module) how can I force a flag to be unique for a specific content type. I do not want to force users to manually 'unflag' content ...
2 votes
0 answers
216 views

How can I limit flagging per user?

Node compare is awesome plugin but it's just only in D7. I'm using Drupal 8. I have a views page which integrated with flag(compare it) and flipped table module to compare contents. It has limit to ...
0 votes
3 answers
3k views

How to print in twig a Flag Link field

I have a views-view-unformatted.html.twig template working fine where I can print fields from a view of nodes. Example: having i = 3, print row number 3 title {{ rows[i]['content']['#row']._entity....
0 votes
1 answer
969 views

Success with cookie, fails with JWT: RuntimeException: Failed to start the session because headers have already been sent

My Controller is working with cookie auth but failing with JWT. This Controller is supposed to flag an entity for the logged-in user. If I am using cookie auth, there are no errors and everything ...
1 vote
1 answer
312 views

Flag count is incrementing only after page reload

I have a views with like and unlike flag. When I click on like flag the count not increments. But when I reload the page, then only like's count will change. How can I solve this issue? Note: I have ...
0 votes
1 answer
299 views

How to unflag/reset a flag again, when matching some conditions in onFlag event?

in my custom module I have an event subscriber service for flag module. I used the tutorial here as a base for learning: Link to Tutorial Here is my code: namespace Drupal\MYMODULE\EventSubscriber; ...

1
2 3 4 5
10