Bar_Smith is looking to embed a Discourse category into a website, similar to how eviltrout embeds comments. Falco mentions that they had planned to create more widgets for embedding, including a latest posts widget, but unfortunately weren’t selected for the project.
TeoWneD is also interested in embedding a category and Falco suggests creating a mockup of what they want to achieve. TeoWneD shares their context and explains that they want to embed a category under a planning section on their website.
Falco provides guidance on how to achieve this by calling the endpoint http://forum.culibo.com/c/Category/latest.json and using the JSON data to construct the HTML. However, TeoWneD encounters an issue with the URL not being found. Falco corrects the URL to http://forum.culibo.com/c/Category/l/latest.json.
Eventually, TeoWneD is able to access the JSON page but encounters a Cross-Origin Request issue when trying to retrieve the data using PHP, jQuery’s load method, and Ajax requests.
I run a community driven open source project and our Discourse forum is the heart of the community.
I am working on a website to host collaborative open source projects and I would like each project page to have a discourse discussion section similar to how @eviltrout has an embedded discourse comments section on his blog:
Instead of just embedding a single topic as a comments section, I would like to embed a category so that there can be multiple discussions going simultaneously.
So here’s my question: Is it possible to embed a discourse category instead of a topic and where do I start?
Thanks for your time! Love everything about discourse.
On the backend code responsible for the page located at dev.culibo.com/planning you must call the endpoint http://forum.culibo.com/c/Femme-Enceinte/latest.json which will respond with a JSON containing all the latest posts in the category.
Use this data to construct the HTML you want on the page.
It means Multiorigines request had been bloqued ( Cross origin request ) The policy do not allow to consult the distant ressources on (https://URL.com) reason is CORS request failed