How to show a download count on files uploaded to a post (Pro hosting, theme component only)?

I would expect someone with 10+ years of experience in Discourse theme development to be able to figure out that Discourse exposes those counts in the post stream json :wink:

Eg. the number of clicks on this link will be counted https://www.rd.usda.gov/sites/default/files/pdf-sample_0.pdf

Then look at https://meta.discourse.org/t/how-to-show-a-download-count-on-files-uploaded-to-a-post-pro-hosting-theme-component-only/417810.json:

and in Javascript you get a post.link_counts array.

1 Like