How to show topic-map on non-commented posts?

Hello,

Now that I saw this topic, I remembered that I had seen a commit about this before. :slightly_smiling_face:

I think this should work now :arrow_down_small:

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)
Screenshot 2023-01-05 at 10.10.38

When someone reply it changes back to the default.

11 Likes