I had to add this functionality as part of a recent project, and thought it might be more useful as part of the flag module itself.

It's just an extra token that creates the flag/unflag link. Patches for 6.x-1.x and 6.x-2.x are attached.

Comments

icecreamyou’s picture

Status: Active » Reviewed & tested by the community

I can confirm that these patches work.

pribeh’s picture

Bump. This works great for me. This is needed in Flag core.

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new2.18 KB

Thanks, I've committed the patch to the 2.x version of the module. 1.x is no longer receiving changes, but I've ported the patch to Drupal 7 and committed this version the 7.x-2.x version.

quicksketch’s picture

Title: Flag link token » Add a token for flag link
dave reid’s picture

Status: Fixed » Needs work
+++ b/includes/flag.token.incundefined
@@ -126,10 +130,14 @@ function flag_tokens($type, $tokens, array $data = array(), array $options = arr
+        $flag_link_token = 'flag-'. str_replace('_', '-', $flag->name) .'-count';

Looks like this should be using '-link' and not '-count'?

quicksketch’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.