Normalized Profile Links

Install this theme component

Add user_custom_field links to user card and profile and attempt to deal with bad user entries. Allow adding links to arbitrary sites.

For example, a user might enter any of these for Twitter (X):

  • https://x.com/MyHandle
  • https://twitter.com/MyHandle
  • https://www.twitter.com/MyHandle
  • x.com/MyHandle
  • twitter.com/MyHandle
  • /MyHandle
  • @MyHandle
  • MyHandle

This theme component will make all of those become “MyHandle”, so if a user enters any of those in the twitter field, the link will become https://x.com/MyHandle. For a site like YouTube where an @ is needed in the URL for the profile link, you need to make the link URL be https://youtube.com/@', so that the link will become https://youtube.com/@MyHandle`. I considered making the @ be part of the handle, but that makes breaks things if a user enters @literatecomputing.com as their BlueSky handle since BlueSky wants the profile URL to be https://bsky.app/profile/literatecomputing.com with no @.

Settings allow adding any site you wish that has some kind of handle that can be appended to some URL.

Note that the custom_field_name and link name are case sensitive. I considered trying to fix this but it was a pain and I decided that admins can deal with making the case match. (Thanks to @NateDhaliwal for trying the theme component and to @Moin and @Richie for pointing out that case sensitivity was an issue.)

If you require additional Font Awesome Icons you can add them to the Additional Icons setting.

A bunch of the sample settings (and associated icons) are provided by AI completion and not tested. You can make changes to the settings yourself, but if you let me know about a broken one (via email or PR) I will be happy to fix it.

Another feature I have considered is making it possible to have entries appear on only the User Card or User Profile, rather than both. If that’s of interest, please let me know, especially if you have a budget.

Why Yet Another Custom Field Theme Component?

The Official Custom Profile Link adds a link for only one custom field. (:person_shrugging:)

Multiple Custom Profile Links is similar to this, but this component adds

  • a simpler customization interface,
  • some error checking/fixing of users adding semi-bogus entries,
  • and the ability to add links to custom services/sites.

Thanks to Gray Arrows Drone Club for funding initial development!

12 Likes

I’m not sure how to get the icons to show? I tried creating a custom user field, but I don’t think that’s how it’s done?

@NateDhaliwal if it helps, here’s the custom user field settings we have for YouTube, also make sure the two Show on... settings are not checked:

Here are the settings used on this theme component for YouTube:

The end result when viewing a user profile:

2 Likes

I see, I had it checked.
I did exactly what you did, but my Github icon isn’t showing.



In the component settings, your input for the field name is “GitHub”, but above the name of the field is “Github”. Maybe it will work if they are the same.

4 Likes

It now works. Thanks a bunch!

3 Likes