Show Name instead of ID for User Combo Box

I’m using the user field type in one of my custom settings and I’m looking for a way to show the name instead of the ID of the user after selection.

For example, it shows the name while you’re selecting. But the chosen value is only displayed as a number, which is not super useful when scanning a grid of options.

Is there a plugin to modify this?

If you change the type to textfield, and leave the value as “aaron”, it will show the name, but I think you’ll lose the ability to select the user by name. MODX assumes that if you set the type to user, it’s because you want to use the user ID for some operations because it’s the most reliable way to identify a user, because the username might change, but the ID never will.

If you only want to display the partner’s name, using as the value would be fine, but if you want to do anything else with it, you’d want to use the ID.

You’re kind of stretching the intended use of System Settings here. They’re not really meant to store information about users.

If you can tell us more about exactly what you’re doing with the settings and why, we might be able to suggest other approaches.

I feel like the user object is the best option. It’s not just about seeing the name. I’m actually planning to assign a lot of custom variables to the user that I can subsequently use for very specific things depending on who the partner is for a given context.

So, yes, I will be using the ID to handle my requests. But for me, it would be useful to be able to see who the actual partner is across multiple contexts versus simply seeing ID 2 and having to remember which partner that represents.

If this were on the frontend, it would be no problem. But since it’s all in EXT, I’m at a loss for how I’d modify the interface to show that.

You might want to look at ClassExtender.

I strongly suggest that you not use the user profile’s extended fields. This article explains why it’s a bad idea.

If you had just a few extra user variables, I’d suggest stuffing them in unused fields of the modUser or modUserProfile objects, but it sounds like that’s not a good option for you.

Assuming that you have some PHP skills, the best option is a custom DB table that stores the extra use fields. ClassExtender will create that for you, and it will automatically insert the extra fields into the Create/Edit User form in the Manager. You will automatically have the user’s ID there and can easily add a field for the name. You’ll see all your custom fields there whenever you edit a user.

Ok great! Thanks for the info. I’ll check out the article and the approach you suggest.

Thanks, Bob!