Support

  1. share24
  2. Bug Report
  3. Thursday, March 10 2016, 11:58 PM
I just purchased the basic edition of Easy Profile since the free version didn't have the author plugin to try.

Right now I have an avatar linked to the stories but what I'm looking for is to have my user profile at the bottom of each content item.

Also, how can I remove the entries where no information was presented?

http://www.ohiovarsity.com/user-profile/stevehare
admin Accepted Answer
Admin
Hi,
sorry for late reply, it was night for us.

how can I remove the entries where no information was presented?
You can set to hide empty fields on profile from Easy Profile configuration (Components->Easy Profile->Option button->Hide Empty Fields on Profie parameter)

Right now I have an avatar linked to the stories but what I'm looking for is to have my user profile at the bottom of each content item.
As replied here, Easy Profile don't do this. You need to write a plugin or override Article Layout.

Plugin
You can write Content plugin that render your fields from our API, Joomla have a built in event for this called "onContentAfterDisplay" (see reference link to more info). Instead write a entire plugin you can add your code in pre-existing plugin (i.e. our Author Plugin), with this way you can simply add your function to show these fields in file /plugins/content/jsn_author/jsn_author.php like this:
public function onContentAfterDisplay( $context, &$article ) {
$doc = JFactory::getDocument();
$doc->addStylesheet(JURI::root().'components/com_jsn/assets/css/style.css');
if(isset($article->created_by) && isset($article->author) && $article->created_by && !is_object($article->author)){
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser($article->created_by);
$article->text.='
<div class="author_info">
<div class="field_about">About: '.$user->getField('about').'</div>
<div class="field_anotherfield">Another Field: '.$user->getField('anotherfield').'</div>
</div>
';
}
}


Article Override View
You can override Article layout, so copy file /components/com_content/views/article/tmpl/default.php into /templates/your-template-folder/html/com_content/article/default.php and add something like this at the end of file:
<?php 
$doc = JFactory::getDocument();
$doc->addStylesheet(JURI::root().'components/com_jsn/assets/css/style.css');
if(isset($this->item->created_by) && $this->item->created_by){
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser($this->item->created_by);
echo '
<div class="author_info">
<div class="field_about">About: '.$user->getField('about').'</div>
<div class="field_anotherfield">Another Field: '.$user->getField('anotherfield').'</div>
</div>
';
}

?>


NOTE: this code is not tested and not supported, this is only for example purpose
References
  1. https://docs.joomla.org/Plugin/Events/Content#onContentAfterDisplay
  2. http://docs.easy-profile.com/index.php/article/jsnuser-object
  1. more than a month ago
  2. Bug Report
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.