# How to create a custom button?

**URL:** https://meta.discourse.org/t/how-to-create-a-custom-button/157717
**Category:** Development
**Created:** [July 14, 2020, 4:04pm UTC](https://meta.discourse.org/t/how-to-create-a-custom-button/157717 "2020-07-14T16:04:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![AntiMetaman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/antimetaman/32/186978_2.png) [@AntiMetaman](https://meta.discourse.org/u/AntiMetaman)
#### Post date: [July 14, 2020, 4:04pm UTC](https://meta.discourse.org/t/how-to-create-a-custom-button/157717/1 "2020-07-14T16:04:47Z")

</div>

Hi,

I’m new to Discourse. I’ve installed it already and am playing around with it. There is one feature I’d really like and maybe this is already possible which is why I’d like to ask.

I want to create a category in my forum which is similar to an image gallery. If the user makes a post in this category, it would appear like a grid with an image thumbnail, and a caption with things like user views, ratings (thumbs up) and date posted.

Note that only this specific category should be shown as grid layout, not other categories.

Furthermore, I want to create my own button that allows a user to upload a specific file. Upon uploading the file, a custom code would convert that file into an image. It’s similar to bbcode. Where is the documentation to create custom buttons with a code?  
 ![image](https://global.discourse-cdn.com/meta/original/3X/0/e/0e095713ce42b5d3ca3a614f56f7d074c4143958.png)

I’m referring to those buttons btw.

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [July 14, 2020, 4:40pm UTC](https://meta.discourse.org/t/how-to-create-a-custom-button/157717/2 "2020-07-14T16:40:16Z")

</div>

> [@AntiMetaman](#):
>
> I want to create a category in my forum which is similar to an image gallery. If the user makes a post in this category, it would appear like a grid with an image thumbnail, and a caption with things like user views, ratings (thumbs up) and date posted.
> 
> Note that only this specific category should be shown as grid layout, not other categories.

Check out these theme-components:

> [@User Portfolio](https://meta.discourse.org/t/user-portfolio-theme-component/156678):
>
> discourse2Summary User Portfolio adds a new “Portfolio” tab to the user profile. It can be configured to show the user’s topics from a specific category and/or tag. It also works great alongside the [Topic List Thumbnails](https://meta.discourse.org/t/topic-list-thumbnails-theme-component/150602)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-user-portfolio](https://github.com/discourse/discourse-user-portfolio)open_bookNew 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 Features

> [@Featured Tiles](https://meta.discourse.org/t/featured-tiles-theme-component/156677):
>
> discourse2Summary Featured Tiles adds a row of featured tiles above topic lists.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/featured-tiles)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-featured-tiles](https://github.com/discourse/discourse-featured-tiles)open_bookNew 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 Features Featured Tiles adds a row of featured tiles above topic lists. On hover, the topic titl…

> [@Topic List Thumbnails](https://meta.discourse.org/t/topic-list-thumbnails-theme-component/150602):
>
> discourse2Summary Topic List Thumbnails allows you to show topic thumbnails in topic list views.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/topic-list-thumbnails-blog) (blog style) [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/topic-list-thumbnails-grid) (grid) [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/topic-list-thumbnail-list) (list) [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/topic-list-thumbnails-masonry) (masonry) [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/topic-list-thumbnails-minimal-grid) (minimal grid)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-topic-thumbnails](https://github.com/discourse/discourse-topic-thumbnails)open_bookNew to Discourse Themes? [Begi…](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966)

> [@AntiMetaman](#):
>
> I’m referring to those buttons btw.

If you want to add a button there, you can reverse engineering other plugins that have successfully done that, like say the [Formatting toolbar](https://meta.discourse.org/t/formatting-toolbar/40649) plugin.

Not sure of the use case of your feature, but that’s why Discourse is free and open, so you can customize it the way you want!

---

<div class="post-metadata">

### Author: ![AntiMetaman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/antimetaman/32/186978_2.png) [@AntiMetaman](https://meta.discourse.org/u/AntiMetaman)
#### Post date: [July 14, 2020, 5:25pm UTC](https://meta.discourse.org/t/how-to-create-a-custom-button/157717/3 "2020-07-14T17:25:10Z")

</div>

Thanks for the reply! I see that the formatting toolbar conflicts with the official bbcode plugin. I’ll have to uninstall the bbcode then to use this one. I’m still looking for some documentation on how to create plugins that allow one to modify the toolbar or to create custom buttons.

Also, yes, the Topic List Thumbnails Component does exactly what I was looking for. I had installed that earlier but it didn’t work for me since I was on stable.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 14, 2020, 6:50pm UTC](https://meta.discourse.org/t/how-to-create-a-custom-button/157717/4 "2020-07-14T18:50:06Z")

</div>

You can keep the official bbcode plugin and use this theme component, it’s more or less the same

> [@MD Composer extras](https://meta.discourse.org/t/md-composer-extras/118912):
>
> This theme component adds few formatting options in the composer : underline, align center, align right, justify and strikethrough. You can customize the text of each button in the settings, making it compatible with every languages. Exist in rtl version (change align right to align left).

---

<div class="post-metadata">

### Author: ![AntiMetaman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/antimetaman/32/186978_2.png) [@AntiMetaman](https://meta.discourse.org/u/AntiMetaman)
#### Post date: [July 15, 2020, 2:13am UTC](https://meta.discourse.org/t/how-to-create-a-custom-button/157717/5 "2020-07-15T02:13:11Z")

</div>

Thanks, I’ll look at that code to see if I can make my own custom button.

---

<div class="post-metadata">

### Author: ![AntiMetaman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/antimetaman/32/186978_2.png) [@AntiMetaman](https://meta.discourse.org/u/AntiMetaman)
#### Post date: [July 18, 2020, 12:36pm UTC](https://meta.discourse.org/t/how-to-create-a-custom-button/157717/6 "2020-07-18T12:36:01Z")

</div>

Just an update on this, it seems that the easiest way to create one’s own custom bbcode is to reverse engineer this plugin: [Awesome BBCodes Plugin: multi-paragraph, nestable, with auto-complete](https://meta.discourse.org/t/awesome-bbcodes-plugin-multi-paragraph-nestable-with-auto-complete/28104) rather than the official bbcode plugin according to this thread: [Best Course of Action on Supporting Custom BBCode?](https://meta.discourse.org/t/best-course-of-action-on-supporting-custom-bbcode/148941)

If there’s a newer or easier way now to create custom bbcode, please let me know. Thanks.
