• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: User custom fields

User custom fields 1 year 3 months ago #42481

  • podpora20
  • podpora20's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 4
How to pre populate form field with custom user entry?
The administrator has disabled public write access.

User custom fields 1 year 3 months ago #42512

  • podpora20
  • podpora20's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 4
Found solution if somebody needs it

//<code>
$user = \Joomla\CMS\Factory::getApplication()->getSession()->get('user');
use \Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
if ($user->id != NULL) {
foreach (FieldsHelper::getFields('com_users.user', $user, 0) as $field) {
if ($field->name == "YOUR-CUSTOM-FIELD-NAME")
{
return $valueXYZ = $field->value;
}

}
}
//</code>
The administrator has disabled public write access.
The following user(s) said Thank You: ssnobben, Specialist, anita.van.dalen, jbroodman

User custom fields 6 months 4 weeks ago #43006

  • marto42
  • marto42's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
Hello, I`ve wondering where I can put this code?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!