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.
Is it currently possible to change the text that displays on a Flag link field in Views? I can't seem to figure it out. If I use "rewrite the output of this field" and set it to a token, I don't have any way to reference the link URL.
Comments
Comment #1
barraponto CreditAttribution: barraponto commentedI'm going through the same problem, I'll see if I can get anything done.
Comment #2
barraponto CreditAttribution: barraponto commentedSo, I managed to theme it from the field_handler. However I was using the AJAX link, and once it is clicked on, the result will be the default flag text. There's absolutely nothing views can do to change that text, at least with the current implementation of the AJAX response. Here is the code I used:
I don't know what can be done about the ajax response, maybe just send a views param, and let the theme function use some specificity like
theme('flag' . '__' . $viewname);
, which would help the themer a lot. It could be used in the handler render() method as well, to save themers a lot of time.Comment #3
joachim CreditAttribution: joachim commentedThe Views handler just calls $flag->theme(), so this issue is dependent on that taking more parameters. Which IIRC there is an issue for.
Comment #4
rodyk CreditAttribution: rodyk as a volunteer commentedFor me the right code is :
It works like this ;)