Set topic title with Discourse Embed

Hello!

I recently set up embedded comments on my website using this wonderful tutorial (Embedding Discourse Comments via Javascript).

My topics are being auto-created by Discourse. However, all the generated topics have the same title “Sign in to your account”.

I assume that the crawler is somehow landing on my website’s sign-in page first and grabbing that page title as the topic title. This doesn’t make too much sense to me because I tried this on a public page (one that does not require authentication). So maybe I am misunderstanding what the craweler does in order to scrape for the page title, description etc.

Regardless, I am not sure if I can change the flow of my current website, so I was wondering if there was a way to set the topic title in Javascript (possibly in the DiscourseEmbed object). Or if I needed to change some crawler settings?

Any thoughts?

3 Likes

Does your site have an RSS or Atom feed? If so, have you tried enabling the ‘Import posts via RSS/Atom’ setting? It makes a difference in terms of how Discourse tries to retrieve the post.

2 Likes

Also to confirm there is no way to pass the title through. There must be some reason your web site is serving the sign in page to the anonymous request Discourse is making.

2 Likes

I just checked and it looks like we don’t use RSS or Atom feed.

I have also been informed that we have an extra layer of security that is causing this hiccup.

I figured our site was doing something weird and I wanted to see if there was a way to pass the topic title or body to Discourse in JS. Thanks for getting back to me!

6 Likes