login_destination module and link with anchor I want to to use login_destination module to have a link to login screen in comment-wrapper.tpl.php, so after the login, the user came back to write the comment.

I have installed and configured login_destination and modified comment-wrapper.tpl.php.

The login_destination documentation say that if I use my own links to the login screen, i have to use GET to supply "current" parameter.

So in my theme I've added to comment-wrapper.tpl.php:

$destino = drupal_get_destination();
$destino = $destino['destination'];


And changed the text to add the link to the login screen:

&lt;?php if ($comment_form): ?&gt;
&lt;h2 class="title comment-form"&gt;&lt;?php print t('&lt;a href="@login"&gt;Login&lt;/a&gt; or anonymous comment:', array('@login' =&gt; url('user', array('query' =&gt; array('current' =&gt; $destino), 'fragment' =&gt; 'comments')))) ?&gt;&lt;/h2&gt;
&lt;?php print $comment_form; ?&gt;


  

Now, when I click on "Login" link, opens an url like:

SITE.com/user?current=node/3#comments


But after finish the login, I'm redirected to node/3 alias, without the anchor #comments.

If I type on the browser the url:

SITE.com/node/3#comments


It' works ok, it goes to the #comments anchor.

Any help or suggerence?

Thanks!
Try this.    

&lt;?php if ($comment_form): ?&gt;
        &lt;h2 class="title comment-form"&gt;&lt;?php l('Login or anonymous comment', user, array('query' =&gt; 'current=node/3#comments')); ?&gt;&lt;/h2&gt;
&lt;?php print $comment_form; ?&gt;