Embending topic in 'another' website. And change redirect page after login

AI-generated summary

The discussion revolves around integrating Discourse into a React mapping application. Andre_driem is considering using Discourse as a forum provider due to its robust implementation and API. They have two main questions:

  1. Embedding a topic: Can a topic, including posts, comments, and a comment box, be embedded into another website? Andre_driem found a possible solution but couldn’t find a feature list or example of how it would render.

  2. Redirecting after login: Can the redirect page after login be changed? Andre_driem plans to place the forum on a /forum subpath and wants to redirect to the root page after login.

In subsequent posts, Andre_driem managed to load and modify the embedded topic to display the post body and title. They also overrode the login modal JavaScript to redirect to the root path after login. However, they are still working on creating a comment box using React.

Additionally, Andre_driem asked if the embed page would validate the login if it’s on the same domain.

Hi, I’m building a react mapping application where the second half of the screen in a map where users can place pins with titles and the the first half of the screen is a topic in a forum related to that pin (with same title/same id).

I’m considering using discourse as a provider for the forum, since it is a very robust and resourceful implementation, and it has an API for creating topics that I can use in the app. It also is written in rails, so i can easly extend the Topic model to include geolocation and a icon field and the TopicController to implement a geojson api to return the nearby lonlat and icons to populate the map.

But i need the confirmation about some features that i couldn’t find on the documentation:

  • Can i embed a topic, in a way the topic post, comments and a widget to post a commend appear in a page? I see this is possible here, but i can’t seem to find a feature list or a print-screen of how this feature would render in another website.
  • Can i change the redirect page after a login? I’m planing on placing the forum on a /forum subpath, and /map for the react map where the / (root) page would redirect to.
  • Will the embed page validate the login if they are on the same domain?

I managed to load the embed topics locally, sadly the post body and reply button is not available, i’ll see if if i can find the hbs file that renders it and if i can easily modify it to include a reply box and the topic body

I managed to find the erb file that implements the posts and modified it so it show the topic post and title as well.


(file app/views/embed/comments.html.erb)

I also managed to override the login modal javascript to redirect path to be / always.

The only quick solution I couldn’t find is a comment box, I think I’ll make a simple one with react