I've created a clickable block with Views and rewrote the fields with HTML like this:
<a href="user"> some divs... </a>
Clicking the block should refer the logged-in user to his/her profile. As the code mentions, I'm using user
as relative link, but a problem occurs when the user clicks the link when he/she is already visiting his/her profile: the link is then turned into mysite/user/user
instead of mysite/user
.
Using /user
doesn't work either, because it redirects the user to localhost/user
instead of localhost/mysite/user
.
What's the correct way to construct a path that takes into account either being relative or the $base_path
?