Add a link Button in a topic

סיכום מבוסס בינה מלאכותית

In a support discussion titled “Add a link Button in a topic,” user Thamer asked how to add a clickable button within a post, ideally styled like an image. pmusaraj explained that direct styling of links via CSS classes is restricted for security and UI consistency, but offered a workaround involving a theme component and custom styling, referencing a meta.discourse.org thread. Chaboi_3000 proposed a simpler, no-code solution: embedding hyperlinks inside images using Markdown syntax: [![lengthxwidth](upload://image.png)](https://example.com). This method allows visual customization and works without theme components. Thamer confirmed this approach worked well for their needs. Later, Thamer asked how to make the link open in a new tab; Chaboi_3000 clarified that links to external domains (e.g., meta.discourse.org from a different site) automatically open in new tabs, while same-domain links open in the current tab. The discussion concludes with a practical, accessible workaround for creating button-like links using image embedding.

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.

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 for more details.

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

Try clicking the image below, it will redirect to meta.discourse.org.

image

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.

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

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

Thanks

@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.