URL to set up new topic and category, tags

I have discovered that we can use Discourse inside an iframe. In this mode, I hide the header etc.

Now I would like to make it a full replacement for our chat / discussion system. Anywhere we have a chat, we can have a discourse topic!

But in order for this to work, I need to be able to direct users in the iframe to a URL that sets up a topic composer and prefills the topic and category. Is that possible to do?

Afterwards, I also would need to get the resulting topic id and URL in the callback, so I can save it on our side and open it next time in the iframe, instead of our own chat that would be opened.

I guess, thinking about it, I can just use PostMessage and Javascript inside Discourse and our own app for all this. Right?

I could have the Javascript simulate clicks and fill elements that have well known IDs or classes, but I would prefer to use some documented Javascript API

Can someone please give me some example code that uses Ember.js that would accomplish the above?

We do support topic creation with prefilled data using URL parameters, hopefully this helps:

We generally do not support using Discourse in an iFrame, so it may be difficult to find support here on Meta related to your setup.

1 Like