First, some surprise – for me at least… went looking at a whole bunch of forum sw the last couple days to see how they handled tags and how they might compare to what I was thinking for an implementation. To my surprise, the only one I found doing tags was BBPress. There must be others and I must have missed them or its a feature folks arent using… Still, I think the power of a tagging system is there… guess we can be trendsetters…
First, the easy part… I plan to allow tagging to be enabled or disabled at the forum level.
So next question becomes where do we allow tagging? at the topic level or the post level? My first instinct was at the topic level. So, whoever creates the topics, sets the tags for that topic. But, I could also see allowing the adding of tags at the post level. The mechnaism of adding tags wont really care. If we do tags at the post level, do we show the tags at the topic level or at a post by post level? Certainly possible to show summary tags at the topic level, but allow users to add new tags at the post level, but of course then we would need to verify that any added tags dont already exist at the topic level. if the tags were kept at the post level, then no worry about duplicates. I can certainly see some benefit to allowing tagging at the post level, but I suspect 90 or 95% of the time, the topic tags (ie the first post in topic) will be sufficient. Take WP for example, you tag the post and others dont tag the comments. BBPress follows the same idea and tags at the topic level with the first post. So, I think we tag at the topic level.
How are tags entered? Tags would be entered into a input field as a comment separated list of key words of phrases. Would have to do some checking/stripping for strange characters/entities/etc.
How are tags stored in the db? I envision creating a new table called sftags. The columns in this new table woud be tag_id, topic_id, tag and tag_slug. Each tag entered for a new topic would get its own row in this table. The tag slug would be used for potential methods of accessing topics by tags (ie url based).
Now, this may not be the most efficient db usage and could grow to be very large. If we wanted to save some db size at the expense of complexity and perhaps queries, an alternative method would be to use two tables. One would be sftags which would be comprised of tag_id, tag and tag slug. The other table would be sftagsmeta. This would be comprised of meta_id and topic_id. When a topic was created, for each tag, if it was a new tag based on looking in sftags table, it would be added to the sftags table and an entry for the topic would be added to sftags meta that pointed to the tag in sftags. If the tag already existed in sftags, then simple a new entry in sftagsmeta would be made pointing to the existing tag in sftags.
Now, not entirely sure of the benefit of the two table system but it just seems like this provides more growth options, perhaps like adding another column to the sftags table for topic_count – how many topics have this tag. Might be a way to easily have a listing of most popular tags. there is probably other benefits and other database options. I guess my current choice would be to go with the two table option.
So, where are tags entered? It doesn really matter whether its topics, as I suggest, or all posts. Thinking of something like the mockup below:
So then, where are tags displayed?
Do we display the tags on the forum view? I would think so. We could put a list of the tags in a table underneath the forum title, but there is already a bunch of stuff in that field. We could add a new column, but that would likely look weird for a bunch of tags. Another option would be another, short (ie not tall vertically) row that spans the entire length of the topic entry (except for the first, topic icon column?). I would try both the under topic title and new row displays to see which one I like better. I would vote against the additional column.
Do we display the tags on the topic view? This would be a given I believe. The location of the display is even more tricky than the forum view. The most obvious places would be at the top or the bottom of the page. I would suggest above or below the sffooter regions (page links). This tag display seems like something that would be nice in the sidebar, but thats probably not a good thing to do and would confuse folks on how to do it.
So, now that we have tags, what do we do with them? A couple of ideas, certainly a lot more possibilities
- search by tag
- most popular tags
- tag clouds (forum or topic)
- related/similar topics
thoughts?


