Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
1. Create a flag with "Display link as field" and "AJAX link".
2. Render that flag as a normal field within the "Manage display" of a node type.
You'll see the link created as:
<a title="" href="/flag/flag/FLAG_ID/NODE_ID?destination=flag/unflag/FLAG_ID/NODE_ID&token=TOKEN" class="use-ajax" rel="nofollow">FLAG_LABEL</a>
Now, create a View with the "Flags" relationship and add "Flag link".
The rendered link will be created as:
<a title="" href="/flag/flag/FLAG_ID/NODE_ID?destination=flag/unflag/FLAG_ID/NODE_ID&token=TOKEN">FLAG_LABEL</a>
Without that "use-ajax" class, the link will always cause a full page refresh.
Comments
Comment #2
Morbus IffComment #3
Morbus IffIgnore. Confirmed fixed in 8.x-4.x.
Comment #4
Morbus Iff