Adding flags on comment form
Last updated on
30 April 2025
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
If you want to add a flag link on a form but instead of through formname.tpl.php you want to add through a function in template.php, you can still add using flag_create_link
For example to add this on comment form just above the text window You would need
$str= flag_create_link('flag_top_10', $form['nid']['#value']). "<br>Your comments ";
$form['comment_filter']['comment']['#title'] = t($str);
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion