How to check the Topic Pageviews in mobile when we don’t have any replies?
AI-generated summary
The discussion revolves around how to check topic views on mobile without replies. Viki initially asks the question, and Stephen responds that the views are displayed below the OP in every topic. However, Viki and Stephen clarify that this doesn’t work without responses.
Bathinda and Viki express interest in finding a workaround. merefield suggests using the Topic List Previews plugin, which can include view data in the Topic List on mobile without requiring additional posts.
Jagster provides a simple script to include in the head of the HTML to enable topic views on mobile:
<script type="text/discourse-plugin" version="0.8">
api.includePostAttributes('topicMap');
</script>
JammyDodger shares additional details and CSS code from Don to enhance the feature and hide unnecessary stats when no other posts are present.
Yes, that’s true, the gray bar below from my screenshot doesn’t appear until the topic has a response.
Any possibilities to enable the views without responses?
I hope there was some data query to check a particular topic views (when topic doesn’t have any replies).
Since posts can have diff views, is there some way to check individual post views also?
FYI Topic List Previews plugin can include that data in the Topic List on mobile (so you don’t even have to navigate to the Topic). It doesn’t require any additional posts than the OP.
Because this bumped…
This goes in head:
<script type="text/discourse-plugin" version="0.8">
api.includePostAttributes('topicMap');
</script>
That’s it.
And yes, I copied it from here but because I don’t remember who gave this snippet in the beginning I can’t link to original.
Edit:
This is one topic and there are others:
This one from Don in the same topic has some extra details in: ![]()

