0

I have created one drupal block containing links which are direct. Ex:login->user/login register->user/register

But if i am in user/login link and clicking the link user/register the path is taking as user/user/register.

Please help me in this Thank you

2 Answers2

3

You need to link to /user/register so your link will be based on home path and not current path.

Or else you can use an absolute path so your link is not dependant of where you are in the site, something like :

<?php
$linkUrl = $base_path . '/user/register';
?>
<a href="<?php print $linkUrl; ?> title="Link to user/register">

https://api.drupal.org/api/drupal/developer!globals.php/global/base_url/7

Laurent Fauvel
  • 631
  • 6
  • 12
0

Use the url function:

$login_url = url('user');
$register_url = url('user/register');
Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102