How to extend composer form with file input via plugin

(Alexander Randa) #1


I try to implement availability to setup topic image (this is primary image and it will displayed in topics list, show, etc)
I write plugin, and add file-type field (similarly to GitHub - discourse/discourse-tagging: Tagging functionality for Discourse Forums)

But I have problem: when I add file via input, file caught by composer file uploader:

Perhaps exists some ability to change this workflow via plugin?

(cpradio) #2

What exactly are you trying to achieve? As Discourse already accepts attachments to posts…

(Alexander Randa) #3

@cpradio Yes, I know about post images.
But I need to implement topic image (not post). Also this image will be processed with some special workflow. And will be showed on topics list, in emails, etc.

(Kane York) #4

Topics already have an image_url field that is set to the first image in the first post, if any.