How to display a flag to anonymous users? I'm using the Flag module, but I have a problem in displaying a flag to anonymous users.

I have 2 flags called "make feature" and "add to Favorites". I want to display this flag to anonymous users too. Currently it is displayed only to the users who are logged in (authenticated user).

I want these flags to be displayed to all users (whether logged in or not). But when an anonymous user clicks on flag than such user should be redirected to the login page. After login the user should be able to set flag.

Is this possible?
You can do this in your 'node.tpl.php' by something like below, if user is logged in display flag as normal and if is not logged in redirect user to logging page with destination parameter

global $user;
if(!$user-&gt;uid) {
    // $flag: bookmark or make_feature, $action: flag, $content_id: $nid.....
    $flag_link = flag_flag_link($flag, $action, $content_id);
    $flag_url = $flag_link['href'];
    if(isset($flag_link['query']['token'])) {
        $flag_url .= '?'.$flag_link['query']['token'];
    }
    print l(t('bookmark'), 'user/login' , array('query'=&gt; array('destination' =&gt; $flag_url)));
} else {
    print render($content['links']['flag']);
}