Create multiple custom fields for a topic

Hello,
I would be happy to help you. I recently created a plugin where I utilized topic custom field (Discourse Chain Topics Plugin).

In my plugin I created an extra two fields for each topic of type of integer. Similarly you could add as many fields as you want. In the end topic/user custom fields, is a JSON object where each field you add will be then be as a key/vale in the JSON obeject . where key is the field name and value is the value.

The example you brough above (which also helped me as well) is built such that you add extra field in admin panel, where you choose its type and name. However you don’t necessarly have to relate the extra fields to admin panel. Simliary you could add as many fields as you want (Not suer how this might affect the performace).

Lastly feel free to ping me/ message for any support you need. You can also find my conact details at https://ghassan.blog
Which you best of luck.

3 Likes