Skip to main content
edited tags
Link
mickmackusa
  • 4.8k
  • 4
  • 18
  • 48
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added a couple more tags
Link
mickmackusa
  • 4.8k
  • 4
  • 18
  • 48

How Toto get User Custom Fields onrelated to Joomla Content?

deleted 622 characters in body
Source Link
Leoalv
  • 167
  • 1
  • 10

It is not a question; I write so that others can do it and share their solutionswant to the problem. Let's suppose that we have added a field for the genre and another field forknow how they get the values of custom user about. What we want is to show that data infields within Joomla articles.

$userId = JFactory::getUser($this->item->created_by)->id;
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('value');
$query->from($db->quoteName('#__fields_values'));
$query->where($db->quoteName('item_id')." = ".$db->quote($userId));

$db->setQuery($query);
$fields = $db->loadColumn();
foreach ($fields as $field) {
    echo $field;
}

This way we are obtaining the data directlyis to contribute ideas and from the user who has created the articleways to solve it.

It is not a question; I write so that others can do it and share their solutions to the problem. Let's suppose that we have added a field for the genre and another field for the user about. What we want is to show that data in Joomla articles.

$userId = JFactory::getUser($this->item->created_by)->id;
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('value');
$query->from($db->quoteName('#__fields_values'));
$query->where($db->quoteName('item_id')." = ".$db->quote($userId));

$db->setQuery($query);
$fields = $db->loadColumn();
foreach ($fields as $field) {
    echo $field;
}

This way we are obtaining the data directly and from the user who has created the article.

I want to know how they get the values of custom user fields within Joomla articles. This is to contribute ideas and ways to solve it.

Source Link
Leoalv
  • 167
  • 1
  • 10
Loading