# Link user field type

**URL:** https://meta.discourse.org/t/link-user-field-type/50077
**Category:** Feature
**Created:** [September 13, 2016, 11:42am UTC](https://meta.discourse.org/t/link-user-field-type/50077 "2016-09-13T11:42:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [September 13, 2016, 11:42am UTC](https://meta.discourse.org/t/link-user-field-type/50077/1 "2016-09-13T11:42:41Z")

</div>

@tobiaseigen has a usecase with custom fields where he’s importing the name of an organisation, and a url, via sso, and wants to display it as a link with the name linking to the url. I can’t imagine user fields of this type - a url and a name - are a want unique to him.

It would seem sensible to me to add a new user field of the type `Link`, which accepts a name and url, and displays the name linking to the url.

No custom user field currently has two input boxes (at least, not that I’m aware of), and so I’m not sure what the most eloquent solution would be for this. I wonder if it might be to make the `Link` field type literally link other fields together. So, you’d have a form something like this:

 ![](https://global.discourse-cdn.com/meta/original/3X/d/d/dd1a1d1afdadb65957017ce7db1cf2ed1a836965.png)

There has been some similar discussion before:

> [@(Retired) Use an ID in a custom user field to link to a user's external profile](https://meta.discourse.org/t/link-custom-user-field-to-external-website/41218):
>
> Let’s say you want to add a link of User’s main profile page on Discourse user profile page and user card, clicking on that link will take user to main (external) website. The link of main website user profile page will be like: http://myawesomewebsite.com/user/USER\_PROFILE\_ID Let’s get started! Create a custom user field Let’s create a user field with name User Profile. Make sure “Show on public profile?” option is enabled. The above field will store external user profile IDs. A…

However this only works with one supplying some sort of username, and a base url common to all of the values of the field (which we don’t have here)

Also this:

> [@Custom User Field Enhancements](https://meta.discourse.org/t/custom-user-field-enhancements/31572/7):
>
> This is not something we are considering at this time. People can add URLs via the “About Me” field, and we have significant protection in that field.

However, the about me field doesn’t allow easy adding of links via sso

Would a PR be welcome?

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [September 13, 2016, 12:15pm UTC](https://meta.discourse.org/t/link-user-field-type/50077/2 "2016-09-13T12:15:19Z")

</div>

I’m questioning if I’ve had a little bit of a brain fart.

I’m wondering if the field link shouldn’t be a field itself, because its values are going to be the same for each user, and so not displayed on the signup form or in the user preferences. But then again it’s going to be presented as a field in every other way (like on the public profile, and user card, if selected).

Some direction here would be invaluable.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 13, 2016, 10:17pm UTC](https://meta.discourse.org/t/link-user-field-type/50077/3 "2016-09-13T22:17:10Z")

</div>

That is a LOT of fields for link. Why does it need so many fields?

 ![](https://global.discourse-cdn.com/meta/original/3X/4/8/483591e2d29979813a940f41648c51c95024ad72.png)

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [September 14, 2016, 8:29pm UTC](https://meta.discourse.org/t/link-user-field-type/50077/4 "2016-09-14T20:29:59Z")

</div>

> [@codinghorror](#):
>
> Why does it need so many fields?

Because it seemed simpler than changing the current fields architecture to support multiple inputs per field (and so also multiple `user.custom_fields` per field). The name of an organisation and the url of an organisation are separate pieces of information, and so separate fields, we just want to display them together as the link [not-really-a-field-but-displayed-as-such](https://meta.discourse.org/t/link-user-field-type/50077/2).

Also I’ve realised that the `Editable after signup?` and `Required at signup?` options are unnecessary because the field wouldn’t be displayed at signup, or in a user’s preferences (which makes me think this shouldn’t be a field, but what instead…? A field view? 🚜 🌳).

 ![](https://global.discourse-cdn.com/meta/original/3X/e/7/e7be8e1d2831fffe6a1241018da6f9c4214a6a6f.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 20, 2016, 10:44pm UTC](https://meta.discourse.org/t/link-user-field-type/50077/5 "2016-09-20T22:44:52Z")

</div>

We are fine to do something here, just need to nail down a UI we are all comfortable with.
