- Posts: 69
COMMUNITY FORUM
How to display extrafields on user.php
- Steven Johnson
-
Topic Author
- Offline
- Senior Member
Less
More
12 years 1 month ago #112091
by Steven Johnson
How to display extrafields on user.php was created by Steven Johnson
Any suggestions on how to display extra fields on user.php?
I have tried many or the variations to get the extra code to display but nothing seems to work.
I have tried many or the variations to get the extra code to display but nothing seems to work.
Log in or Create an account to join the conversation.
- Andrey Miasoedov
-
- Offline
- Senior Member
12 years 1 month ago - 12 years 1 month ago #112092
by Andrey Miasoedov
Replied by Andrey Miasoedov on topic Re: How to display extrafields on user.php
Hello, Steven.
You need to use the following sintax:
<?php echo $item->extraFields->fieldAlias->name; ?>
<?php echo $item->extraFields->fieldAlias->value; ?>
And also add a core hack for make it work in components\com_k2\models\item.php
Add || $task == "user" to extrafields condition (line ~181):
//Extra fields
if (($view == 'item' && $item->params->get('itemExtraFields')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemExtraFields')) || ($view == 'itemlist' && $task == 'tag' && $item->params->get('tagItemExtraFields')) || ($view == 'itemlist' && ($task == 'search' || $task == 'date') && $item->params->get('genericItemExtraFields')) || $task == "user")
{
$item->extra_fields = K2ModelItem::getItemExtraFields($item->extra_fields, $item);
}
You need to use the following sintax:
<?php echo $item->extraFields->fieldAlias->name; ?>
<?php echo $item->extraFields->fieldAlias->value; ?>
And also add a core hack for make it work in components\com_k2\models\item.php
Add || $task == "user" to extrafields condition (line ~181):
//Extra fields
if (($view == 'item' && $item->params->get('itemExtraFields')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemExtraFields')) || ($view == 'itemlist' && $task == 'tag' && $item->params->get('tagItemExtraFields')) || ($view == 'itemlist' && ($task == 'search' || $task == 'date') && $item->params->get('genericItemExtraFields')) || $task == "user")
{
$item->extra_fields = K2ModelItem::getItemExtraFields($item->extra_fields, $item);
}
Please Log in or Create an account to join the conversation.
- Steven Johnson
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 69
12 years 1 month ago #112093
by Steven Johnson
Replied by Steven Johnson on topic Re: How to display extrafields on user.php
Thanks so much for the reply and info.
Everything worked perfectly.
-- Steven
Everything worked perfectly.
-- Steven
Please Log in or Create an account to join the conversation.