Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How-to build tagging system like SO?

Tags:

string

c#

How-to build tagging system like SO ?

I'm using a unique textbox on my asp.net mvc website to submit "tags".

First of all, i tried to split tags with commas "asp.net, c#, sql server". It works but if user forgot to seperate tags with commas i've a problem to split that string.

"asp.net c# sql server" : sql server should be a single tag, not two "sql" + "server".

Moreover i "can't" (he should not take care about this ...) ask user to use "-" character to seperate words of the tag : "sql-server"

Someone help ?

like image 232
Yoann. B Avatar asked Feb 10 '10 23:02

Yoann. B


People also ask

What is a tagging strategy?

Tagging provides a way for organizations to identify various resources on AWS — and can help companies understand their usage, costs, performance, and more. A tagging strategy defines specific rules and practices for an organization to follow and implement.

What are the benefits of tagging?

Tags help social marketers group and categorize posts for flexible reporting on content, creative and campaigns. Customers across industries use them to unlock key performance insights and move their strategies forward.


2 Answers

There's one (easy) way I can think of to allow your user to include any character in a tag. That solution is to allow the user to enter only one tag at a time. You could have a textbox where the user enters the tag (autocompletion for existing tags is a definite plus), presses enter or a button when finished entry, and the entered tags appear below the textbox in a list of applied tags. Those applied tags must have a button for each tag in order to allow the user to remove the tag.

Wordpress has a similar tagging mechanism when you create posts, but they allow multiple tags to be entered at once by simply stating what character delimits tags. Asking for a delimiter is not a big deal, but if you don't want to mandate a particular delimiter, you'll simply have to restrict the user to entering a single tag at a time.

image of wordpress's tag box

Another Idea (edit)

I just read this today: Tokenizing Control

like image 161
Benny Jobigan Avatar answered Oct 24 '22 11:10

Benny Jobigan


StackOverflow has exactly the same problem with users incorrectly entering tags, for example if you had entered 'string manipulation' instead of 'string-manipulation'. You've just changed the tag separator from space to comma.

The fundamental problem is still the same, so it is no surprise that the solution is also the same:

  1. Educating your users via convenient help on your site.
  2. Moderators that helpfully go round fixing other users mistakes, cleaning up the site.
  3. Moderators also educating your users when they make mistakes so that they don't make the same mistake in future.

StackOverflow proves that this model can work well. An automated solution for correcting user errors will sometimes make errors itself because of the ambiguity you pointed out yourself. This will frustrate people who are doing it correctly only to be foiled by the software "fixing" their tags for them.

like image 24
Mark Byers Avatar answered Oct 24 '22 10:10

Mark Byers