# Gebruik standaard deel-icoon voor deel-bericht (in plaats van link-icoon)

**URL:** https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416
**Category:** UX
**Created:** [27 februari 2023 om 18:14 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416 "2023-02-27T18:14:05Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![bquast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bquast/32/289307_2.png) [@bquast](https://meta.discourse.org/u/bquast)
#### Post date: [27 februari 2023 om 18:14 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/1 "2023-02-27T18:14:05Z")

</div>

In recent times share icon has become more or less standardized as

 ![png-clipart-share-icon-social-media-computer-icons-social-networking-service-sharing-icon-social-media-share-icon](https://global.discourse-cdn.com/meta/original/4X/d/a/1/da1862dd405badf6f528248b6a0e020aae8471a1.png)

or

 ![share](https://global.discourse-cdn.com/meta/original/4X/7/3/b/73bc4dbcf9b1fcfc912d046c2afa1e6c2db35812.png)

I think the former is the most standard.

On Discourse the share post icon is a link (as in links-in-a-chain) icon. This also works well, but I think nowadays the nodes icon at the top here is most recognized.

Is there a recommended way to change this?

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [27 februari 2023 om 18:40 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/2 "2023-02-27T18:40:49Z")

</div>

The default code would be:

```plaintext
<script type="text/discourse-plugin" version="0.8">
  api.replaceIcon('link', 'share-alt');
</script>

```

Strangely this doesn’t work. It does work with other icons used just next to it, like `bookmark` or `flag`. `link` should be the icon’s name though..

@darkpixlz you recently posted about replacing the link icon with a cake in the sidebar.. did you use a different icon name here?

---

<div class="post-metadata">

### Author: ![bquast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bquast/32/289307_2.png) [@bquast](https://meta.discourse.org/u/bquast)
#### Post date: [27 februari 2023 om 18:55 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/3 "2023-02-27T18:55:13Z")

</div>

Thanks, I tried this as well (in header) it indeed did not work.

Your code is to edit this element correct?

```plaintext
<svg class="fa d-icon d-icon-d-post-share svg-icon svg-node" aria-hidden="true">
  <use xlink:href="#link">
  </use>
</svg>

```

So `d-icon-d-post-share`?

Sorry I’m quite new to (modern) javascript / CSS

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [27 februari 2023 om 19:10 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/4 "2023-02-27T19:10:12Z")

</div>

> [@manuel](#):
>
> @darkpixlz you recently posted about replacing the link icon with a cake in the sidebar… did you use a different icon name here?

I made a feature request to do it, but I wasn’t ever able to get it manually.

Update: I see what you mean, it was basic inspect element, not an actual plugin

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [27 februari 2023 om 19:50 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/5 "2023-02-27T19:50:54Z")

</div>

It used to be the `link` icon, but that replaced the link icon where the share icon wouldn’t make sense (like on the formatting bar button for adding a link).

I just tested the below and it seems to work as intended:

```js
api.replaceIcon('d-post-share', 'share-alt');
api.replaceIcon('d-topic-share', 'share-alt');

```

The first replaces the icon within posts, the second replaces the icon for the Share button at the bottom of a topic.

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [27 februari 2023 om 20:04 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/6 "2023-02-27T20:04:06Z")

</div>

ah cool @renato! works like a charm 🎉

Actually `external-link-alt` can look good as well..

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/f/9/7f9a3cfa168d7ff3adbc98f6c181e4ffa7f6e006.png)

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [27 februari 2023 om 20:11 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/7 "2023-02-27T20:11:15Z")

</div>

Except external link is not same as sharing… no matter how good is looking 😉

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [27 februari 2023 om 20:22 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/8 "2023-02-27T20:22:44Z")

</div>

hmm.. I guess I wouldn’t worry that much about an icons “etymology” 🤓 but rather if it’s commonly used in that context. And this seems pretty much the case here, e.g. here’s a view from twitter:

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

---

<div class="post-metadata">

### Author: ![bquast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bquast/32/289307_2.png) [@bquast](https://meta.discourse.org/u/bquast)
#### Post date: [27 februari 2023 om 20:24 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/9 "2023-02-27T20:24:22Z")

</div>

Thanks Renato. For me the icon disappears.

```plaintext
<script type="text/discourse-plugin" version="0.8">
  api.replaceIcon('d-post-share', 'share-alt');
  api.replaceIcon('d-topic-share', 'share-alt');
</script>

```

To the header using a theme component (using the default theme). I get:

 ![Screenshot from 2023-02-27 21-22-47](https://global.discourse-cdn.com/meta/original/4X/a/f/2/af2215b37f66bd374ee1f08896a92720295a32ee.png)

Do I need to do something else, maybe the icons need to be added?

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [27 februari 2023 om 20:24 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/10 "2023-02-27T20:24:33Z")

</div>

> [@manuel](#):
>
> I wouldn’t worry that much about an icons “etymology”

Well, it woud be nice if users understand the function too 😉

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [27 februari 2023 om 20:32 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/11 "2023-02-27T20:32:13Z")

</div>

Go to settings and search `svg icon subset`. Add `share-alt` and you are good to go.

---

<div class="post-metadata">

### Author: ![bquast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bquast/32/289307_2.png) [@bquast](https://meta.discourse.org/u/bquast)
#### Post date: [27 februari 2023 om 20:35 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/12 "2023-02-27T20:35:50Z")

</div>

Awesome thanks @Jagster

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [27 februari 2023 om 20:46 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/13 "2023-02-27T20:46:08Z")

</div>

> [@Jagster](#):
>
> Except external link is not same as sharing

Well, agree to disagree, I find the share icon a better representation of the action than a link icon, but that’s just me. Also, if you’re on mobile, this action will actually open the OS share UI, and I’m pretty sure that the link approach is only used because we don’t have a good support for the Web Share API on desktop just yet.

---

<div class="post-metadata">

### Author: ![bquast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bquast/32/289307_2.png) [@bquast](https://meta.discourse.org/u/bquast)
#### Post date: [27 februari 2023 om 20:50 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/14 "2023-02-27T20:50:37Z")

</div>

If I understand the comment by @Jagster correctly, he is not arguing against the use of `share-alt` for the external-link-plus-SM-share popup on desktop / OS share UI on mobile, but rather he saying that since it is a share functionality, using the external link icon wouldn’t cover the functionality entirely.

That’s my interpretation, I could be wrong

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [27 februari 2023 om 21:08 UTC](https://meta.discourse.org/t/use-standard-share-icon-for-share-post-instead-of-link-icon/256416/15 "2023-02-27T21:08:42Z")

</div>

Oh, I think you’re right and I totally missed the context…

I’m sorry @Jagster!
