# Aangepaste profiellink

**URL:** https://meta.discourse.org/t/custom-profile-link/295470
**Category:** Theme component
**Tags:** custom-profile-link
**Created:** [15 februari 2024 om 12:23 UTC](https://meta.discourse.org/t/custom-profile-link/295470 "2024-02-15T12:23:30Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [15 februari 2024 om 12:23 UTC](https://meta.discourse.org/t/custom-profile-link/295470/1 "2024-02-15T12:23:30Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | Add a custom link to the user profile |
| 🛠 | **Repository** | [GitHub - chapoi/discourse-profile-custom-link · GitHub](https://github.com/chapoi/discourse-profile-custom-link) |
| ❓ | **Install Guide** | [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

A small component to add a customisable link on the user profile.

#### Shows on…

1. The expanded user profile  

2. The usercard  

#### Settings

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/4/5/b45014b09061c7e20c64336fc11af8d8b42c1db4.png)

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:

1. Create the user field  

2. Set setting to user field name  

3. 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](https://meta.discourse.org/t/multiple-custom-profile-links/295547)

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [27 februari 2024 om 15:09 UTC](https://meta.discourse.org/t/custom-profile-link/295470/2 "2024-02-27T15:09:25Z")

</div>

Does this get “nofollow”? Will it be sent akismet?

This is definitely going to be used by spammers!

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [29 februari 2024 om 20:49 UTC](https://meta.discourse.org/t/custom-profile-link/295470/3 "2024-02-29T20:49:42Z")

</div>

> [@chapoi](#):
>
> `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?

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [1 maart 2024 om 09:41 UTC](https://meta.discourse.org/t/custom-profile-link/295470/4 "2024-03-01T09:41:53Z")

</div>

> [@Firepup650](#):
>
> Just a quick nitpick, that should be `http://github.com/`, right?

Haha yes, that’s a typo. Thanks. I’m not reinventing url structures here 😜

> [@Firepup650](#):
>
> Also, any particular reason why this suggests http GitHub instead of https?

Not at all

---

<div class="post-metadata">

### Author: ![Julian2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julian2/32/434355_2.png) [@Julian2](https://meta.discourse.org/u/Julian2)
#### Post date: [24 juli 2024 om 13:36 UTC](https://meta.discourse.org/t/custom-profile-link/295470/5 "2024-07-24T13:36:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [24 juli 2024 om 14:08 UTC](https://meta.discourse.org/t/custom-profile-link/295470/6 "2024-07-24T14:08:43Z")

</div>

> [@Julian2](#):
>
> Quick note: there is an extra “the” in the description text below the “profile custom link icon” field 🙂

Nice catch. 👍 This should tidy it up:

[https://github.com/discourse/discourse-profile-custom-link/pull/7](https://github.com/discourse/discourse-profile-custom-link/pull/7)

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [24 juli 2024 om 15:36 UTC](https://meta.discourse.org/t/custom-profile-link/295470/7 "2024-07-24T15:36:54Z")

</div>

> [@Julian2](#):
>
> Is there a specific reason I have to add a component for this, instead of adding another field type for the User Fields?

I’m not sure I follow the question. User fields aren’t all automatically shown on the profile or usercard.

---

<div class="post-metadata">

### Author: ![Julian2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julian2/32/434355_2.png) [@Julian2](https://meta.discourse.org/u/Julian2)
#### Post date: [25 juli 2024 om 11:38 UTC](https://meta.discourse.org/t/custom-profile-link/295470/8 "2024-07-25T11:38:11Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/1/c/e1c456daf03505f83a72ab418be5b70caf797030.jpeg)

Links have to be copy-pasted instead of just being clickable.

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [25 juli 2024 om 15:55 UTC](https://meta.discourse.org/t/custom-profile-link/295470/9 "2024-07-25T15:55:45Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Julian2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julian2/32/434355_2.png) [@Julian2](https://meta.discourse.org/u/Julian2)
#### Post date: [25 juli 2024 om 16:27 UTC](https://meta.discourse.org/t/custom-profile-link/295470/10 "2024-07-25T16:27:05Z")

</div>

Awesome, thanks! 💐

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [26 juli 2024 om 18:20 UTC](https://meta.discourse.org/t/custom-profile-link/295470/11 "2024-07-26T18:20:44Z")

</div>

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](https://meta.discourse.org/c/feature/2), and seeing if that garners more interest.

Cheers!

---

<div class="post-metadata">

### Author: ![Joseph\_Tucker1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joseph_tucker1/32/253029_2.png) [@Joseph\_Tucker1](https://meta.discourse.org/u/Joseph_Tucker1)
#### Post date: [30 juli 2024 om 18:57 UTC](https://meta.discourse.org/t/custom-profile-link/295470/12 "2024-07-30T18:57:32Z")

</div>

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]/](https://www.domain.com/user/%5BUSER-ID%5D/)”. 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?

```plaintext

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;
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [30 juli 2024 om 19:58 UTC](https://meta.discourse.org/t/custom-profile-link/295470/14 "2024-07-30T19:58:17Z")

</div>

@Julian2 I have just posted a feature request for this here, didn’t see your posts on this topic

> [@Clickable link / URL user field type](https://meta.discourse.org/t/clickable-link-url-user-field-type/319322):
>
> A user field type of link / URL that shows as a clickable link on user card, profile etc As you can see, the URL’s are not clickable Thank you

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2 december 2025 om 07:32 UTC](https://meta.discourse.org/t/custom-profile-link/295470/16 "2025-12-02T07:32:54Z")

</div>

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]`

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [6 december 2025 om 14:22 UTC](https://meta.discourse.org/t/custom-profile-link/295470/18 "2025-12-06T14:22:47Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [6 december 2025 om 15:07 UTC](https://meta.discourse.org/t/custom-profile-link/295470/19 "2025-12-06T15:07:46Z")

</div>

Indeed, the actual issue turned out to be caused by a user error.
