Discourse Tag Cloud

Does the size of a word depend on how many times its been used as a tag?

Correct. I should add that to OP

I got an error message saying Refused to load the script 'https://{{some url}}.js' because it violates the following Content Security Policy directive: "script-src" and Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

Looks like you haven’t permitted your site to use scripts from your uploads folder?

You need an entry like so:

image

(with your own domain).

1 Like

Thanks, and I found it only queries tags from “Other Tags” if there are tag groups that existed.

Ah, interesting. Thanks for the feedback. Its only been tested without tag groups. I’ll take a look sometime…

I’ve just taken a look at this, I:

  • Created a new Tag Group
  • added an existing Tag to the Group.
  • refreshed front page
  • Tag still showed in the Cloud.

So cannot reproduce your issue? Please provide complete steps to reproduce.

Would this Tag Cloud be the most spoken words in the forum? Like a twitter trending topic?

No, it’s literally a cloud of Discourse Tags. However, I also made: Word Cloud plugin (which is linked in the OP btw), which sounds more like what you are describing?

1 Like

Is there something similar to Twitter’s Trending Topics? Like, the most popular topics of the day (typed in topics)

Core Discourse has that already, it’s called the Top list:

image

I think the translation came out wrong, I meant the most cited words of the day, example: Queijo, Carne, The Weeknd, Xtina, American Idol

[image]

1 Like

The Word Cloud plugin is probably closest but that doesn’t have a time dimension (yet), it takes aggregate statistics from the entire forum (or select Categories).

Awesome! I’ve always wanted to have a tag cloud in Discourse, so am glad to see this theme component is available. Nice work!

The CSP thing is weird - I ran into the same error, and it ultimately only worked for me when I added the path specified in the error which was:

https://SITEURL/uploads/default/original/1X/
1 Like

I check the source code and find the computed tags property only returned tags group in tags.json, the others are in extras.tag_groups. However, I couldn’t figure out how to fix the issue.

1 Like

Well done for having a go, but if you want me to fix anything it would be most useful to have functional steps to reproduce, please, from the front end, as if just a user, because right now I can’t see the problem.

I just installed the component and go to /tags page and only find tags without a group assigned show up in the cloud.

Update: sorry I forgot to mention the list tags by group option is enabled, it had been a while since I enable it, i forgot it was off by default

1 Like

I am able to reproduce this. If you enable the tags listed by group setting, you will only see the ungrouped tags in the tag cloud.

Screen Shot 2022-02-15 at 1.03.58 PM

In the process, I also am getting this error.

Slow down, too many requests from this IP address.
Please retry again in 3 seconds.
Error code: ip_10_secs_limit.
3 Likes

thanks, that would have saved a lot of time.

I’ll add it as a known issue until I get time to look at this (done).

Now supports Tag Groups (when tags listed by group is set)

This works by iterating through the Tag Groups and adding any tags within them to the list, that’s it.

FEATURE: support extracting tags from tag groups for inclusion · merefield/discourse-tc-tag-cloud@55949e7 (github.com)

cc: @th21 @tobiaseigen

3 Likes