cuny-academic-commons / commons-in-a-box

Commons In A Box - A suite of community and collaboration tools for WordPress, designed especially for academic communities
http://commonsinabox.org
72 stars 14 forks source link

Tag Clouds for Group Forums - New Feature #94

Open vothsco opened 10 years ago

vothsco commented 10 years ago

It would be useful to add this functionality to make searching forum topics easier. Currently you can tag topics, but there is not a place where these tags are displayed on the group forum page.

boonebgorges commented 10 years ago

Cool idea! At least part of this could probably be built as a patch for bbPress. Here's a ticket that was (imo incorrectly) closed: http://bbpress.trac.wordpress.org/ticket/1837 Such a tag cloud would probably be specific to the currently-displayed forum.

Extending this for BP/Commons In A Box would mean group-awareness. This is a bit more of an edge case, but may still be appropriate for bbPress.

On 12/14/2013 09:15 AM, vothsco wrote:

It would be useful to add this functionality to make searching forum topics easier. Currently you can tag topics, but there is not a place where these tags are displayed on the group forum page.

— Reply to this email directly or view it on GitHub https://github.com/cuny-academic-commons/commons-in-a-box/issues/94.

r-a-y commented 10 years ago

Generating a tag cloud for all forums shouldn't be hard (just pass the 'topic' taxonomy to wp_tag_cloud()) or use the existing widget as explained in the ticket mentioned above.

If you're talking about a tag cloud specific to the current forum, this would have to be custom-built at the moment, which can then be passed upstream to bbPress. Sounds like a lot of queries though from the outset.

BP group-awareness shouldn't be too hard once the main functionality is done.

boonebgorges commented 10 years ago

If you're talking about a tag cloud specific to the current forum, this would have to be custom-built at the moment, which can then be passed upstream to bbPress. Sounds like a lot of queries though from the outset.

Yeah, this is what I was thinking. I'd have to look closer at how WP's tag cloud generators work, but the logic would be something like:

  1. Get ids of all topics/repiles associated with the current forum (I think this'd be a meta_query WP_Query, given the way that bbPress stores this data)
  2. Get object_terms for those IDs (wp_get_object_terms() accepts an array of ids, I think)
  3. Build a tag cloud using the found terms

The queries in 1 and 2 would be above and beyond what a normal tag cloud does, and 1 would be slowish because of the meta_query, but it wouldn't be too many extra queries. I can try to whip up a proof of concept when I get a spare moment

On 12/16/2013 03:23 PM, r-a-y wrote:

Generating a tag cloud for all forums shouldn't be hard (just pass the 'topic' taxonomy to |wp_tag_cloud()|) or use the existing widget as explained in the ticket mentioned above.

If you're talking about a tag cloud specific to the current forum, this would have to be custom-built at the moment, which can then be passed upstream to bbPress. Sounds like a lot of queries though from the outset.

BP group-awareness shouldn't be too hard once the main functionality is done.

— Reply to this email directly or view it on GitHub https://github.com/cuny-academic-commons/commons-in-a-box/issues/94#issuecomment-30696796.