By David Cleworth on Monday, 06 May 2019
Posted in Technical Issues
Replies 1
Likes 0
Views 645
Votes 0
Hi

I am trying to create a unique link for each logged in user. The link needs to change depending on which user is logged in (I have about 50 staff who will be using the site).

I have created an override of the easyblogwelcome module. Within the code I have added:


<div class="eb-mod-item">
<a href="<?php echo $author->getName();?>/travelling">
<span class="mod-cell">
<i class="mod-muted fa fa-car"></i>
</span>
<span class="mod-cell">Travelling Expenses</span>
</a>
</div>


Using the author name adds a space between the first name and last name so the link won't work. Is there a variable I can call such as:


<?php echo $author->getAuthorAlias();?>


So that when, for example Joe Bloggs is logged in, his link will show up as joe-bloggs/travelling

Then I can setup that menu item within Joomla so that it points to his own page each time he logs in.

Or is there a different way to create a link for each logged in user? I've attached a screengrab of the menu.

Thank you
Hi David,

You can use the code below to get the user's alias:
[gist type="php"]
$authorAlias = $author->getAlias();
[/gist]

Hope this help.
·
Monday, 06 May 2019 12:33
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post