User profile by ID instead of username

Summary: Supports linking to user pages by their user id instead of just username

I needed this because my website’s database stores a reference to discourse users by their ID, and I didn’t want to have to keep usernames in sync between the two databases (since usernames can change).

:link: GitHub: GitHub - 29th/discourse-user-by-id: Supports linking to user pages by their user id instead of just username
:arrow_right: Install: Follow the plugin installation guide.

Features

/user-by-id/123/summary redirects to /u/janedoe/summary etc.

I’m still new to developing plugins, so I’d love any feedback on how this could be improved (e.g. is a whole Engine really necessary? Would another route be more conventional? Is there some way to do this without a plugin?), including code quality. Thanks!

3 Likes