How to sync the Topic view count back to the discourse?

Hi @angus,

Thank you for your insight. I will look into the code base for topic views.

Regarding the SPA app:

Originally we had a forum plugin on Wordpress, they creates their own post type for questions and answers as well as category and tags. Upon setting up the SSO with WP Discourse plugin, I enabled Webhooks on discourse to sync topics to Wordpress with that post type, and using the embedding for answers.

At this point, the forum frontend is boring since each question item relying on its WP data only able to show title and author and I’d like to show the posters, views, likes and replies status as well. It didn’t make sense to me to modify that plugin.

With a SPA, pulling and display data would been much faster and flexible. It shows paginated latest topics, and a sidebar with Top topics, included with filter/search capability.

Originally, in the topic details view, I wanted to handle displaying the answers/replies as well. For some reason, the embedded replies was showing posters’ username instead of full name.

I also came across problems with the emoji and other assets are relative to the discourse site, so I fallback to stick with embeds.

Another problem was SEO, I was able to handle it with wp_head hook in WordPress.

1 Like