chapoi
February 15, 2024, 12:23pm
1
Install this theme component
A small component to add a customisable link on the user profile.
Shows onā¦
The expanded user profile
The usercard
Settings
If you leave profile custom link field empty, it will default using the username, so in the example case it would go to
http://github.com/charlie
If you want to use a custom user input field, you have to set the value to the exact name of the userfield, example:
Create the user field
Set setting to user field name
Have users fill out the field
/u/[username]/preferences/profile
Now it will go to http://github.com/MyRealGithubName
For a more advanced implementation, take a look at the Multiple Custom Profile Links component
22 Likes
mattdm
(Matthew Miller)
February 27, 2024, 3:09pm
2
Does this get ānofollowā? Will it be sent akismet?
This is definitely going to be used by spammers!
1 Like
Firepup650
(Firepup Sixfifty)
February 29, 2024, 8:49pm
3
Charlie:
http://github/com/
Just a quick nitpick, that should be http://github.com/, right?
Also, any particular reason why this suggests http GitHub instead of https?
4 Likes
chapoi
March 1, 2024, 9:41am
4
Haha yes, thatās a typo. Thanks. Iām not reinventing url structures here
Not at all
4 Likes
Julian2
(Julian R)
July 24, 2024, 1:36pm
5
Hey @chapoi ! So glad I found this component. Iāve just added to our forum, thanks! I might even switch to the āmultiple linkā version.
Quick note: there is an extra ātheā in the description text below the āprofile custom link iconā field
Is there a specific reason I have to add a component for this, instead of adding another field type for the User Fields?
Cheers
2 Likes
Nice catch. This should tidy it up:
main ā setting-desc.-edit
merged 04:12PM - 24 Jul 24 UTC
4 Likes
chapoi
July 24, 2024, 3:36pm
7
Iām not sure I follow the question. User fields arenāt all automatically shown on the profile or usercard.
2 Likes
Julian2
(Julian R)
July 25, 2024, 11:38am
8
Hey Charlie,
sorry for not being clearer. It would be great if there was a field type for user fields, that allows links instead of just text.
Or are we utilising User Fields all wrong? Here is how we are using them right now:
Links have to be copy-pasted instead of just being clickable.
1 Like
chapoi
July 25, 2024, 3:55pm
9
Ok now I follow, thanks!
Yeah, thatās actually a fair point you bring up. Iāll look into the possibility of your suggestion; my guess is that there is a reason why that wasnāt done, but I donāt know atm.
2 Likes
chapoi
July 26, 2024, 6:20pm
11
So, I had a look but the necessary changes are way above my designer skills (read: backend databas-y stuff) ā so Iām afraid it will be necessary to use the plugin.
An option you could consider is making a feature request , and seeing if that garners more interest.
Cheers!
2 Likes
This solution is great and I hope we can help improve it. Our profile link is of the form āhttps://www.domain.com/user/[USER-ID]/ ā. The trailing slash wrecks the solution for us. I can add a URL rewrite but a better solution would be to make the code more adaptive. I want working real links back to the site!
I tried to convert the plugin to a theme so I could improve the javascript but that CONVERT Discourse function doesnāt seem to be working.
Can you make the update so that it adds functionality?
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { service } from "@ember/service";
export default class ProfileCustomLink extends Component {
@service site;
@tracked customLinkUrl;
@tracked customLinkFieldId;
@tracked showCustomLink = false;
@tracked user = this.args.model.username;
@tracked userFields = this.args.model.user_fields;
constructor() {
super(...arguments);
if (settings.profile_custom_link_field) {
const siteUserFields = this.site.user_fields;
if (!siteUserFields) {
return;
}
const customLinkField = siteUserFields.filterBy(
"name",
settings.profile_custom_link_field
)[0];
if (!customLinkField) {
return;
}
this.customLinkFieldId = this.userFields[customLinkField.id];
if (!this.customLinkFieldId) {
return;
} else {
this.showCustomLink = true;
if (settings.profile_custom_link_prefix.includes("[CUSTOM-LINK-FIELD-ID]")) {
const url = settings.profile_custom_link_prefix.replace("[CUSTOM-LINK-FIELD-ID]", this.customLinkFieldId);
this.customLinkUrl = url;
} else {
const url = settings.profile_custom_link_prefix + this.customLinkFieldId;
this.customLinkUrl = url;
}
}
} else {
const url = settings.profile_custom_link_prefix + this.user;
this.customLinkUrl = url;
this.showCustomLink = true;
}
}
}
@Julian2 I have just posted a feature request for this here, didnāt see your posts on this topic
2 Likes
RGJ
(Richard - Communiteq)
December 2, 2025, 7:32am
16
This component seems to have stopped working on v2025.11
[THEME 2 'Custom Profile Link'] Deprecation notice: The array.filterBy is a deprecated Ember native array extension. Use native array methods or a TrackedArray instead. [deprecated since Discourse 3.6.0.beta1-dev] [deprecation id: discourse.native-array-extensions.filterBy]
1 Like
chapoi
December 6, 2025, 2:22pm
18
Iām on 2025.12 and it still seems to work for me. Thatās just a deprecated warning, not an error, so it should still be fine.
Can you tell me more about what youāre experiencing?
1 Like
RGJ
(Richard - Communiteq)
December 6, 2025, 3:07pm
19
Indeed, the actual issue turned out to be caused by a user error.
2 Likes