XF 2.2 Can custom fieldA shows the value of custom fieldB?

gogo

Well-known member
Custom thread fields:

Name: John Wick
Gender: Male
Age: 39


Can I make it to something like

John Wick (Male, 39)

in thread view?
 
Assuming your custom user field for the gender is named gender and the value is stored as e.g. Male, then you can use this:

Code:
{$user.username} ({$user.Profile.custom_fields.gender}, {$user.Profile.age})

Note that the age will only show if the member has allowed it in their privacy options.
 
Assuming your custom user field for the gender is named gender and the value is stored as e.g. Male, then you can use this:

Code:
{$user.username} ({$user.Profile.custom_fields.gender}, {$user.Profile.age})

Note that the age will only show if the member has allowed it in their privacy options.

Maybe I used a bad example that didn't explain my question clearly enough.

This is for displaying custom thread fields in thread view.

For example, I have 2 custom thread fields:

Country: UK
Region: Europe

The above is how we normally see in a thread.

My question is if I can make the custom thread fields showing in the following style?

Country: UK (Europe)
--The Region line being hidden/skipped--
 
But the problem is the thread contains other custom fields that I want to show in normal ways. I guess the custom fields (should be) are displayed in loop? If I change the lines in template will I change all other fields as well?

I've tried to use the wrap html option in custom fields option but it won't work.

This is very important to me as it will vastly reduce the length of custom fields.
 
You can select which custom fields are displayed on a per custom field basis.
I want to show all custom fields in the thread but I'm also interested to know where and how I can selectively show custom fields.

Back to my problem I still have no clue which template to edit to make the display changes to custom thread fields.
 
I can't really explain it any more than I already have.

Uncheck this for the custom user fields you want to show in a custom format:
1604689625358.png

Edit the message_macros template and add your custom string.
 
@Brogan I tried to digest what you've said but seems I can't really get it. Maybe there's some mis-understanding between my request and your solution.

2020-11-09-19-13-29.png


Again how do I get this done?
 
Back
Top Bottom