# Add a link Button in a topic

**URL:** https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785
**Category:** Support
**Created:** [July 4, 2020, 6:14pm UTC](https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785 "2020-07-04T18:14:48Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Thamer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thamer/32/183183_2.png) [@Thamer](https://meta.discourse.org/u/Thamer)
#### Post date: [July 4, 2020, 6:14pm UTC](https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785/1 "2020-07-04T18:14:48Z")

</div>

Hi,

I am wondering how can I add a Button in a topic?

Can be merged with the text.

Sorry about the simplicity in my question, but it can be something like this picture below.

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/5/3563479ddcb974f85845024f26bd9fb167adf007.png)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [July 6, 2020, 12:50am UTC](https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785/2 "2020-07-06T00:50:31Z")

</div>

You can’t easily do this, for security (and UI consistency) classes on link tags are stripped in the composer.

There is a roundabout way to do something like what you are looking for, but it requires an extra theme component and some extra styling, see [Adding classes to links in post body for styling - #3 by Johani](https://meta.discourse.org/t/adding-classes-to-links-in-post-body-for-styling/131027/3) for more details.

---

<div class="post-metadata">

### Author: ![Chaboi\_3000](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chaboi_3000/32/163015_2.png) [@Chaboi\_3000](https://meta.discourse.org/u/Chaboi_3000)
#### Post date: [July 6, 2020, 1:20am UTC](https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785/3 "2020-07-06T01:20:41Z")

</div>

For our case we use a workaround using links embedded in images. Looks something like:

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/2/c2bd83030482333e833a36f8c607a72ea31e8ffa.png)

Try clicking the image below, it will redirect to [meta.discourse.org](http://meta.discourse.org).

[![image](https://global.discourse-cdn.com/meta/original/3X/1/0/101f03af29f12ea30e1226eb96a02c3ed2f6d2ef.png)](https://meta.discourse.org)

Format:  
`[![lengthxwidth](upload://image.png)](https://example.com)`  
If you don’t want a specified dimension you can leave the box blank.

Could be something you can try. Doesn’t require a theme component or anything. If you are willing to make your own “button”, then this will probably be the best choice.

---

<div class="post-metadata">

### Author: ![Thamer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thamer/32/183183_2.png) [@Thamer](https://meta.discourse.org/u/Thamer)
#### Post date: [July 6, 2020, 10:25am UTC](https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785/4 "2020-07-06T10:25:15Z")

</div>

Thanks for the solutions everyone! I will try them out and let you know which one works better for me.

---

<div class="post-metadata">

### Author: ![Thamer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thamer/32/183183_2.png) [@Thamer](https://meta.discourse.org/u/Thamer)
#### Post date: [July 6, 2020, 4:03pm UTC](https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785/6 "2020-07-06T16:03:39Z")

</div>

@Chaboi_3000 your suggestion worked well for me, now I can customize images and create links from them.

Thanks

> [@Chaboi\_3000](#):
>
> Format:  
> `[![lengthxwidth](upload://image.png)](https://example.com)`  
> If you don’t want a specified dimension you can leave the box blank.

@Chaboi_3000 how can I create this link for opening a new tab?

---

<div class="post-metadata">

### Author: ![Chaboi\_3000](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chaboi_3000/32/163015_2.png) [@Chaboi\_3000](https://meta.discourse.org/u/Chaboi_3000)
#### Post date: [July 6, 2020, 10:56pm UTC](https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785/7 "2020-07-06T22:56:53Z")

</div>

> [@Thamer](#):
>
> @Chaboi_3000 how can I create this link for opening a new tab?

It will automatically open a new tab as long as the websites are different. (eg. Going from theme creator-\>meta discourse will open a new tab). If it shares the same domain/website, then it’ll open that link on the same tab.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [August 5, 2020, 10:56pm UTC](https://meta.discourse.org/t/add-a-link-button-in-a-topic/156785/8 "2020-08-05T22:56:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
