Hey, for metric report purposes, I’m trying to see if there’s a setting or CSS implementation to show the topic-map for all posts (even posts that don’t have comments)?
Above is a screenshot of a post not showing any topic-map
Above is an imgur showing the topic-map once it has at least one comment
Any insight is appreciated! Thanks!
2 Likes
I haven’t tried these out, so I may be mistaken, but there are a few ‘summary’ options in the Admin/Other settings that may tweak what you need:
/admin/site_settings/category/uncategorized?filter=Summary
Sorry, I think I had a brainfart and conflated a couple of different things.
2 Likes
I had somebody check out the Admin Settings for me and they said they couldn’t find it. I don’t have access
There are a few workarounds in this topic (variations of ‘add a post’):
Is there a way to show the topic-map even if there is no reply? We are using many wiki threads and there are rarely replies but the statistics right in the thread would be nice anyway.
Thanks, in advance.
2 Likes
There’s not a setting for this, it requires the topic to have at least one reply. Is there a specific reason you want it to show?
3 Likes
I was thinking about that as a last option type of thing. Don’t really want to add a filler comment/post for the sake of keeping things streamlined.
1 Like
Hey, @awesomerobot
Yes. I am performing weekly metric reports on posts/publications to begin analyzing traffic and engagement with certain topics/teams.
but more specifically, the view count is what you’re after? everything else would show 0:
We’ve had a couple requests for this, so maybe we should work out a mini-topic-map that shows the views in the case where there’s only a single post…
6 Likes
Yes, just the view count. That would help keep the high-priority metrics consistent between all posts.
It would be super awesome if you and your team takes some time to work on something. I’m sure a number of people would appreciate it =)
Hello, I was wondering if it’s possible now to see topic view for post without comments now ?
1 Like
Hello and welcome @Salome_renaud
You can see them on the main topic list, but I’m afraid it’s still not possible to get a topic map for topics with no replies.
renato
(Renato Atilio)
January 4, 2023, 10:01pm
14
Just a reminder that this is not possible on mobile, so there’s actually no way (that I know of) to see the topic views count on mobile if the topic has no reply.
2 Likes
Don
January 5, 2023, 7:21am
15
Hello,
Now that I saw this topic, I remembered that I had seen a commit about this before.
I think this should work now
Header
<script type="text/discourse-plugin" version="0.8">
api.includePostAttributes('topicMap');
</script>
I’ve also added a little CSS to hide unnecessary stats when no other posts.
Common / CSS
body:not(.archetype-private_message) {
.topic-post.regular {
// if last-of-type is the #post_1
&:last-of-type {
article#post_1 {
.topic-map {
width: max-content;
nav.buttons {
display: none;
}
ul li {
// hide all statistics but views
&:not(.secondary.views) {
display: none;
}
}
// show views on mobile view
.secondary.views {
.mobile-view & {
display: list-item;
text-align: center;
}
}
}
}
}
}
}
Desktop (with no reply)
Mobile (with no reply)
When someone reply it changes back to the default.
14 Likes
merefield
(Robert)
January 5, 2023, 9:52am
16
Artem Gordon:
the view count
But if that’s all you need that is already on the Topic List, why do you need to even go into the Topic view for this metric?
You can even leverage the Top list to sort the Topic List by number of views within a given period …
4 Likes
Bathinda
(Bathinda Helper)
November 21, 2023, 1:22pm
17
When topic is not showing in the topic list, then how can we see the views of a topic, that has no replies and is a bit old.
Moin
November 21, 2023, 1:33pm
18
You can filter the topic list for a category and (or) a tag. Because there are lees topics it is easier to find the one you are looking for. Example for your topic.
With the new filter options of Experimental topics list filter feature you can filter the topic list even more. For example you can filter for topics with only one post.
Latest topics with max 1 post
3 Likes
@Moin
Thank you very much for suggesting this ‘filter’ route to me. Thanks.
Btw, what’s the diff if I search/filter: “posts-max:-1” and without minus sign: “posts-max:1”
1 Like
Bathinda
(Bathinda Helper)
May 16, 2024, 8:36am
20
Thank you very much @Don
You provided a very simple, efficient and convenient solution to this. It works exactly as desired.
Bathinda
(Bathinda Helper)
August 14, 2024, 6:52am
21
@Don I am using this code as a component, and perhaps it was working earlier, but stopped suddenly working when I removed it from my current, default, theme and then readded the same (didn’t change any character in the code).
Code/Component:
Not showing, even after Ctrl+F5 in the browser, you can see here :
Moin
August 14, 2024, 6:55am
22
There is now a show_topic_map_in_topics_without_replies
setting which you can use
The PR with the small improvements it’s merged now, among some cleanup and fixes, most notable changes are the two new to site settings:
show_bottom_topic_map
show_topic_map_in_topics_without_replies
2 Likes