从现有标签列表中选择标签的最佳 UI 是什么?

发布于 2024-07-12 05:07:01 字数 217 浏览 12 评论 0原文

我正在使用 django 标记。 我的模型仅包含一个带有逗号分隔的标签列表的字段。 我希望用户能够从现有标签列表中选择标签,并允许用户添加标签。 仍然产生一个以逗号分隔的标签列表。 我该怎么做呢?

下拉列表不起作用。 我正在考虑简单地列出标签字段下方的所有标签,当用户单击现有标签时,会使用一些 JavaScript 将其添加到标签字段中。

非常欢迎其他想法。

I am using django-tagging. My model simply contains a field with a comma separated list of tags. I would like the user to be able to select tags from a list of already existing tags and also allow the user to add tags. Still resulting a comma-separated list of tags. How would I do that?

A pull down list doesn't work. I was thinking about simply listing all tags beneath the tag field and when a user clicks on an existing tag this is added to the tag field with a bit of javascript.

Other ideas are very welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

两仪 2024-07-19 05:07:01

如果你可以使用 jquery,有几个插件可以处理这个问题并节省你的 JS 编码:

Tag Suggest< /a> 可以处理逗号分隔的标签列表和 Autocomplete ,它也具有使用的优点作者:Jannis Leidel 的优秀ForeignKey 模型字段的自动完成表单小部件

If you can use jquery there are several plugins to handle this and save you the JS coding:

Tag Suggest which can handle comma delimited tag lists and Autocomplete which also has the advantage of being used by Jannis Leidel's excellent autocomplete form widget for ForeignKey model fields

玩心态 2024-07-19 05:07:01

拥有一个单独的完整列表是一个好的开始。 我还建议在用户在框中输入标签名称时自动完成实现。 这有助于消除将蝙蝠侠、蝙蝠侠和蝙蝠侠作为三个单独标签的问题。

Having a separate complete list is a good start. I would also suggest an autocomplete implementation while the user is typing a tag name into the box. This helps eliminate the problem of having Batman and Bat-man and Bat Man as three separate tags.

不乱于心 2024-07-19 05:07:01

我认为您显示所有标签并允许用户单独选择它们的建议是一个合理的方法。 Delicious.com 使用了这个确切的界面,而且效果非常好。

I think your proposal of showing all tags and allowing the user to select them individually is a sound approach. Delicious.com uses this exact interface and it works wonderfully.

拍不死你 2024-07-19 05:07:01

是否可以像 Stack Overflow 处理首页上被忽略和有趣的标签一样来实现它? 等待用户开始输入,然后向服务器发出 AJAX 请求并开始返回五个最可能的结果,然后您可以将其显示在文本框下方的悬停白色框中。

How about implementing it the same way Stack Overflow does for the ignored and interesting tags on the front page? Wait for the user to start typing, and as they do, fire off AJAX requests to the server and start returning the five most likely results, which you can then display in a hovering white box below the text box.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文