Custom Fields in message/message_user_info Template

Michael

Active member
I want to use the data from one of my custom fields in the message template, for example my custom field identifier is my_identifier, what is the code I would need to show the output of the my_indentifier field in the message template?

Thank you :)

Edit: I am aware that I can use the options but what do I use if I want it in the message template and only to pull one of them?
 
How would I accomplish showing the text (instead of the value) from a custom thread field instead of a custom user field?

i.e.
${customFields.my_field} shows the Value, how do I get it show the actual Text field? I can't find a <xen:helper userFieldValue...> equivalent.

Thanks
Sean
 
Hello everyone, could you help me please,

I have a question for my users with three check boxes (the global unic ID is "unic_id1")

01 is unic field of the check box1
02 is unic field of the check box2
03 is unic field of the check box3

I would like to show "text-1" when only checked the number 2

<xen:if is="{$user.customFields.unic_id1} == '02'">
text-1
</xen:if>

And , if I check first AND third I would like to show "text-2":

<xen:if is="{$user.customFields.unic_id1} == '01' and {$user.customFields.unic_id1} == '03'">
text-2
</xen:if>


I know that I'm doing wrong something, but I don't know what.
 
Last edited:
The custom fields are not prepared for the member list. But you can edit this file to prepare them:

library/XenForo/ControllerPublic/Member.php

Add the red code inside of the actionIndex() function:

Rich (BB code):
        $criteria = array(
            'user_state' => 'valid',
            'is_banned' => 0
        );

        // users for the member list
        $users = $userModel->getUsers($criteria, array(
            'join' => XenForo_Model_User::FETCH_USER_FULL,
            'perPage' => $usersPerPage,
            'page' => $page
        ));

        $users = $userModel->prepareUserCards($users);

        // most recent registrations
        $latestUsers = $userModel->getLatestUsers($criteria, array('limit' => 8));

        // most active users (highest post count)
        $activeUsers = $userModel->getMostActiveUsers($criteria, array('limit' => 12));

That will allow you to use this code inside of the member_list_item template:

Rich (BB code):
{$user.customFields.field_id}

I think it should say Add the red code inside of the actionList() function:
Some reason even with that correction, I am unable to acccess custom fields using {$user.customFields.field_id}
 
I think it should say Add the red code inside of the actionList() function:
Some reason even with that correction, I am unable to acccess custom fields using {$user.customFields.field_id}


Hi all, me too. It seems that this modification doesn't work anymore.

@Jake Bunce could you or someone suggest how to "prepare" the custom fields for the member list, please? :)
 
Top Bottom