1. benjamin-st-george-botfield
  2. Support
  3. Tuesday, March 06 2018, 11:52 AM
Hi, I want to take user profile data and display it in a RS forms form.
I have done this for Name and e-mail using
//<code>
$user = JFactory::getUser();
return $user->get('email');
//</code>

I have tried this with the field names of my custom user fields, but it won't pull the user data back.

Can you advise on how I can make this work please.
Thank you.
admin Accepted Answer
Admin
  1. more than a month ago
  2. Support
  3. # 1
Hi thank you for your quick response.

I have tried that link and I have used several of the codes:
For example $user=JsnHelper::getUser(); echo $user->getField('school_name'); - I see this code in the text box, not the school name. I have tried it in a custom html module as well, it's the same.

I have also tried //<code>
$user=JsnHelper::getUser(); echo $user->getField('school_name');
//</code>
This just returns an empty field.


Is there an additional plugin I have to use?
Thanks.
  1. more than a month ago
  2. Support
  3. # 2
admin Accepted Answer
Admin
Hi,
I have tried that link and I have used several of the codes:
For example $user=JsnHelper::getUser(); echo $user->getField('school_name'); - I see this code in the text box, not the school name. I have tried it in a custom html module as well, it's the same.
I don't know how to works RSForm, anyway this is the correct PHP code like
$user = JFactory::getUser();
return $user->get('email');


I have also tried //<code>
$user=JsnHelper::getUser(); echo $user->getField('school_name');
//</code>
This just returns an empty field.
in this code missing the library
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');


I have tried it in a custom html module as well, it's the same.
Custom module can't parse PHP, it trigger only content plugin, if you need to load a value with content plugin then you need to see doc at http://docs.easy-profile.com/index.php/article/content-plugin
  1. more than a month ago
  2. Support
  3. # 3
  • Page :
  • 1


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