Multiple Custom Profile Links

AI-generated summary

Firepup650 introduces a theme component that allows administrators to add customizable links to user profiles. This tool is distinct from the official “Custom Profile Link” component and enables the display of external username fields in both user profiles and cards. The component offers several configuration settings, including custom_profile_link_user_field_ids, custom_profile_link_labels, and custom_profile_link_prefixes, which must be configured with lists of equal length to function correctly. Additional options include support for “organization” style links and a debug mode for troubleshooting. The author notes that users seeking a simpler setup for a single link should consider the official component instead.

Subsequently, newbit1337 announces an update to the component, converting the .hbs and .js files to .gjs format using discourse-gjs-codemod. While the pull request for this migration is under review, users can test the changes by cloning the temporary fork and checking out the gjs-migration branch. This branch will remain available until the pull request is accepted.

(Not to be confused with the official component, “Custom Profile Link”)

Install this theme component

A component that lets you add customizable links to user’s profiles.

User Profiles:

User Cards:

Settings:

  • custom_profile_link_user_field_ids - a list of user fields to use for the external username fields
  • custom_profile_link_labels - a list of labels to use for the links, one per id in custom_profile_link_user_field_ids
  • custom_profile_link_prefixes - a list of url prefixes to use for the links, one per id in custom_profile_link_user_field_ids
  • custom_profile_link_orgs - a list of “organization” style links, following the format of label,id-of-name-field,id-of-url-field
  • custom_profile_link_debug_mode - enables some debug logs for the component, should you have issues with it

Notes:

  1. The lists for the settings custom_profile_link_user_field_ids, custom_profile_link_labels, and custom_profile_link_prefixes should all be the same length, potential to cause issues if they’re not.
  2. You can define duplicate ids in the custom_profile_link_user_field_ids field by adding underscores to the numbers for each duplicate entry.
  3. If you’d prefer to only have one link, with easier setup, you should use the official Custom Profile Link theme component.
9 Likes

I have updated the component (converted the .hbs and .js files to .gjs via discourse-gjs-codemod).
While the pull request is under review, you can test it using this temporary fork and the gjs-migration branch: GitHub - newbit1337/discourse-custom-profile-link at gjs-migration · GitHub The branch will remain available until the pull request is accepted.

newbit1337

2 Likes