8

I have a view with lists of 10 nodes with a node display type (not rows). Every node has a flag. How to make possible to flag ONLY one node of these 10 nodes, for example if you have flagged one node - you cannot flag another one untill you unflag flagged one. Just like a best answer functionality on this site. Thanks :)

8

You're looking for the Flag trim action, which you can implement with Rules.

If you make a rule that is activated on the event "Node is flagged" with "Trim the flag" for the relevant user to "1", then the other flags will be cancelled and only the most recent flag will remain.

  • If a separate listing of 10 different nodes are presented to the user, will this action reverse prior flags as well? Eg, does this cause the user to be able to cast only one flag per flag type? – Jimajamma Aug 2 '13 at 18:13
  • @Jimajamma Yes, my understanding is that this will reset the flags for that flag type. – Patrick Kenny Aug 2 '13 at 23:26
  • ...time to put on my jquery thinking cap and figure out a way to make flags on a current page act like radio buttons – Jimajamma Aug 3 '13 at 0:31
  • worked! You just creating a new rule: Node is flagged: your_flagname, then in actions you have to choose Trim a flag. – Alexander Kim Aug 6 '13 at 8:59
0

Is Flag Limit module what you are looking for?

This module allows any flag (for example: bookmarks) to have a limited number of items.
...
There is a new feature in the 7.x-1.x branch that optionally lets you limit the number of flaggings each item can have. Once the limit is reached, nobody else can flag the item.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.