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:
<?php if ($comment_form): ?> <h2 class="title comment-form"><?php print t('<a href="@login">Login</a> or anonymous comment:', array('@login' => url('user', array('query' => array('current' => $destino), 'fragment' => 'comments')))) ?></h2> <?php print $comment_form; ?>
Now, when I click on "Login" link, opens an url like:
But after finish the login, I'm redirected to node/3 alias, without the anchor #comments.
If I type on the browser the url:
It' works ok, it goes to the #comments anchor.
Any help or suggerence?