Link author name to user profile in front-end - How? - Joomla! Forum - community, help and support


i thought built-in option turns out isn't. want link author's name in front end user profile, again in front-end.

i have tried edit default.php file in my-template/html/com_content/article/ have been unable achieve goal.

here's relevant code:

code: select all

<?php $author =  $this->item->author; ?>
<?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?>
<?php if (!empty($this->item->contactid ) &&  $params->get('link_author') == true):?>
<?php echo jtext::sprintf('com_content_written_by' , jhtml::_('link',jroute::_('index.php?option=com_contact&view=contact&id='.$this->item->contactid),$author)); ?>
<?php else :?>
<?php echo jtext::sprintf('com_content_written_by', $author); ?>
<?php endif; ?>


so, here, script checks if author has been added in list of contacts , links name contacts page, showing basic details , contact form.

now, don't want this, want show information user has provided upon registration (i've modified user profile plugin).

i tried changing code not check if author listed contact (easy) , edited jroute parameter should take me user's profile:

code: select all

<?php if ($params->get('link_author') == true): ?>
<?php echo jtext::sprintf('com_content_written_by' , jhtml::_('link',jroute::_('index.php?option=com_users&view=user&id='.$this->item->user_id),$author));
?>


i seem have written jroute *almost* correctly because takes me own profile, not author's.

i tried:
$this->item->user_id / $this->item->userid --- produces nothing, it's incorrect
$this->item->id --- produces article's id.

so, guess big question how author's/user's id?

please not recommend external plugin.

hello,

to that, can use community builder :
http://extensions.joomla.org/extensions ... nities/210





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support