Embedding a list of Discourse Topics in another site

I see all the requested topics: https://forum.flowster.app/embed/topics?discourse_embed_id=de-k0ofgk7q0&category=17&per_page=5&template=complete&top_period=all

Maybe the div where the iframe lives is too small for you to see the other ones?

2 Likes

@Falco Thanks for your help! Using that link I see multiple topics, however why doesn’t this html code work? Am I doing something wrong with the <d-topics-list> tag?

<!DOCTYPE html>
<html lang="en">
  <head>
	<script src="https://forum.flowster.app/javascripts/embed-topics.js"></script>
</head>
<body>
	<d-topics-list discourse-url="https://forum.flowster.app" template="complete" top_period="all" category="17" per-page="5"></d-topics-list>
</body>
</html>
2 Likes

Does anyone know the answer? Why my HTML code above doesn’t work? :cry:

2 Likes

When google renders a page that features the Discourse topic embed feature it seems to use capital <div> elements.

The below is a screenshot of the rendered HTML from the google search console.

2 Likes

One issue with embedded topic lists is that when an embedded topic list entry is clicked, users are always taken to the first post in the topic. We had a request via our support system to ask if there was anyway that users could be taken to the last post in the topic instead of the first.

If this is something that would be useful for other sites, is there any way that a last parameter could be added to the embed code so that users would be automatically taken to the last post in the topic instead of the first one?

I realize that this goes against the idea that discussions are intended to be read from the beginning to the end, but since it’s not possible to store a user’s last read post on the site that the topic list is embedded on, allowing sites to point users to the last post in the topic might be reasonable for this case.

7 Likes

I thought this was worth bringing up again its sort of a severe SEO issue to have on a page.

The headers for the urls created using the embed topics have a x-robots-tag: noindex,indexifembedded

The indexifembedded is only for the google

It should look more like X-Robots-Tag: googlebot:noindex,indexifembedded

Or perhaps just remove the tag all together.

The real negative is that bing or any other crawler will not index or account for the content displayed by the embed topic. ( because it only picks up on the noindex part )

An example url

1 Like

That is exactly what we want right? I don’t want any crawlers to index anything under /embed/topics directly.

2 Likes

Hi @Falco

Im dont think so as that would mean my example url doesnt get indexed.

https://discuss.flynumber.com/embed/topics?discourse_embed_id=de-d49rj6kge&template=complete&allow_create=true&search=Australia&per_page=5

Google is crawling those urls as separate urls. Distinct from the url the embed topic is displayed on.

It will still crawl my url

https://www.flynumber.com/products/virtual-phone-number/australia

but Bing will get to the embed/topics url , see the nonindex and not count that towards the above url.

While Google wont index the embed/topics url but since it understands the “indexifembedded” it will still count the content towards the page where the embed is displayed.

2 Likes

After using this, here’s some feedback…

It would be nice to include several category and not just one. I’ve had to tinker in order to not display certain threads. Using the exclude_tag works for this.

However, I created an admin tag which I append to threads I don’t want displayed on the embed. When I tried changing the setting for my admin tag to Tags are visible only to the following groups it removes the exclude_tag functionality.

I was hoping to hide the tag on my forum, and still have the tag excluded from the embed.

Has anyone trying embedding Discourse on Salesforce Page say Community using LWC? I don’t think would be recognized there.

Not the end of the world but the search parameter doesn’t include tags attached to the topic.

I have this for example

<div class="rss-widget">
<h2 style="text-align: center;">Forum topics related to the US</h2>
<hr>

<script defer src="https://discuss.example.com/javascripts/embed-topics.js"></script>

<d-topics-list discourse-url="https://discuss.example.com"  template="complete" search="usa" per-page="7"></d-topics-list>
</div>

It wont display topics with the “usa” tag, if a type “usa” into the body of a post , it show up.

1 Like

Hi!
Is it possible to show the tags (or the category) of a topic in the embedded list? Or to add the CSS classes that are available on the main page, so that we can style the topics?

I guess what I am looking for is to be able to make the embedded topic list look just like the topic list on the main page… for example this one: Topics tagged official

2 Likes