Keyword

Trying to link to "My Page" within module

  • Mike Brogan
  • Mike Brogan's Avatar Topic Author
  • Offline
  • New Member
More
12 years 9 months ago #60270 by Mike Brogan
Trying to link to "My Page" within module was created by Mike Brogan
Hi, I'm using a module that let's me use php (FlexiCustomCode) and I'm wondering if it is possible to have a link for when a user is logged in to go to "My Page."

I tried using this code (taken from userblock.php):
<a href="<?php echo JRoute::_(K2HelperRoute::getUserRoute($user->id)); ?>"><?php echo JText::_('My Page'); ?></a>

But when the link shows on the front end it does not have the user id and so it doesn't link up right, for instance if the username is mikebrogan, the url would be:

/index.php?option=com_k2&view=itemlist&task=user&id=:mikebrogan

where it should be:

/index.php?option=com_k2&view=itemlist&task=user&id=62:mikebrogan

Anyone fixed this problem or know what I'm doing wrong?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum