Any way to display Location below the name in posts?

AI-generated summary

In a UX-focused discussion titled “Any way to display Location below the name in posts?”, Chandra asks if it’s possible to show a user’s profile location (specifically town/city) beneath their username in posts to boost engagement. pfaffman suggests a plugin would be needed to modify the serializer, noting that a theme component alone would be inefficient. merefield recommends a national flags plugin for country-level display, but Chandra clarifies the need for finer granularity (city/town). pfaffman points to the flag plugin as a code reference for building a custom solution. renato mentions the Locations plugin, which can display location under usernames — though it uses a custom field. Chandra notes it currently shows map links and plans to explore adapting it to display plain location names. renato adds that the plugin allows disabling geocoding to store location as a simple string, which may meet Chandra’s needs.

Hi, is there a way to display the location of a member (from the profile) below the user name in posts?

Location has a significant bearing on our site discussions and displaying the location improves engagement. I am aware it is in the user cards but am looking to have it in the posts.
Thank you.

Looks like you’d need a plugin to add the location to the serializer. The alternative with a theme component would take a bunch of API calls, so I think you don’t want to do it that way.

If you’re self-hosted you could make or commission a plugin to add the information and then it would be easy enough to add the location to a theme component (or in the plugin).

3 Likes

If the granularity of nations is not too coarse for you, consider:

2 Likes

Actually, it is the town, city - so need to pick it up from the profile field.

1 Like

The flag plugin has examples of the pieces you’d need if writing a plugin yourself is an option, but it’s still a bit of work.

1 Like

IIRC the locations plugin has an option to show the location below the username on all posts, but I think it uses a whole different/custom field for that.

1 Like

Thanks, newbie on creating a plugin here, but will dig deeper.

Thanks, looks like a map link.
Will explore what it takes to replace with location name.

This plugin is really powerful and has a lot of settings, I think you can just set location geocoding to none and the address field will be stored as string, with no geocoded location.

2 Likes