# How to customize discourse composer editor

**URL:** https://meta.discourse.org/t/how-to-customize-discourse-composer-editor/243882
**Category:** Development
**Created:** [November 2, 2022, 3:09am UTC](https://meta.discourse.org/t/how-to-customize-discourse-composer-editor/243882 "2022-11-02T03:09:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![YAN](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yan/32/212753_2.png) [@YAN](https://meta.discourse.org/u/YAN)
#### Post date: [November 2, 2022, 3:09am UTC](https://meta.discourse.org/t/how-to-customize-discourse-composer-editor/243882/1 "2022-11-02T03:09:08Z")

</div>

Our forum is expecting a feature: when images are uploaded, before users click the “reply” button, the textarea can automatically prompt up some instructions to ask for some tags for the image. e.g. there will be an extra line generated automatically after the line of the image in some fixed format, which can later be filled up by the users.

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/c/d/9cdec5e057ace731830eb178d62ef0e5bbddf12e.png)

The reason we need this feature is that we need tags for all images in all posts/replies in the forum, and this simple mechanism can help our users to follow the rule, and help our server to store the well-tagged images in the database.

I’m trying to achieve this by modifying a few js files, such as  
/discourse/app/assets/javascripts/discourse/app/components/composer-editor.js  
or  
/Users/yanxiaofeng/discourse/app/assets/javascripts/pretty-text/addon/upload-short-url.js

But I’m not quite familiar with discourse and js 🤣 I find a few [plugins](https://github.com/spirobel/discourse-basic-editor/blob/master/test/javascripts/acceptance/discourse-basic-editor-test.js.es6) working with the composer editor but obviously they are not only changing one or two js files, and I’m confused about the scope and difficulty of building this feature.

Any comments/ideas/suggestions/references are appreciated!!!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 4, 2022, 2:17pm UTC](https://meta.discourse.org/t/how-to-customize-discourse-composer-editor/243882/2 "2022-11-04T14:17:18Z")

</div>

> [@YAN](#):
>
> I’m trying to achieve this by modifying a few js files, such as  
> /discourse/app/assets/javascripts/discourse/app/components/composer-editor.js  
> or

You don’t want to do that. See [Beginner’s guide to developing Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648)

If you mean “tag” in the Discourse sense, tags are for topics, not uploads or posts, so you might need to implement those some other way, or perhaps you could use the Discourse tags for your purposes.

You might rather develop a plugin, which would let you create upload-specific “tags”. You might have a look at [Video Upload to YouTube and Vimeo using Theme Component](https://meta.discourse.org/t/video-upload-to-youtube-and-vimeo-using-theme-component/170079) for an example of something that seriously changes how uploads work. You might, for example, want to have Discourse upload those images to some other site altogether rather than make Discourse be a file manager.

---

<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: [December 4, 2022, 2:17pm UTC](https://meta.discourse.org/t/how-to-customize-discourse-composer-editor/243882/3 "2022-12-04T14:17:26Z")

</div>

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