我想在外部脚本上使用类似 drupal 的分类系统

发布于 09-13 05:42 字数 59 浏览 11 评论 0原文

对于我的网站,我会添加一个类别系统来组织内容,就像 drupal 分类法一样。 这样的东西已经存在了吗?

For my site, i would add a category system to organize content just like the drupal taxonomy.
Do something like this already exist?

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

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

发布评论

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

评论(1

凉墨2024-09-20 05:42:38

您应该对这些表进行编码:
1.分类词汇(词汇id、名称)
2.分类术语(术语id、名称、词汇id、顺序)
3. 内容的分类链接(术语 ID、内容 ID)

并且您应该有内容表,其中包含内容 ID。

现在您应该编写用于添加/删除/编辑词汇表和术语的代码。在内容编辑中,您应该提供术语链接(在某处或此处选择词汇并分配术语 ID -> 添加到第三个表)。

之后,您应该提供术语列表、包含某些术语的内容类型列表等......

ps 使用 drupal 而不是您自己的代码,因为 drupal 是由数百名开发人员在超过 10 000 小时内测试的,而不是您的代码在不到 100 小时内由 1 个人测试:)

You should code these tables:
1. taxonomy vocabulary (vocabulary id, name)
2. taxonomy terms (term id, name, vocabulary id, order)
3. taxonomy link to your content (term id, content id)

And you should have content table, that has content id.

Now you should write code that will add/delete/edit vocabularies and terms. In content editing you should provide linking to term (selecting vocabulary somewhere or here and assign term id -> add to 3rd table).

After this you should provide listing of terms, listing of content type that has some term and etc...

p.s. Use drupal instead of your own code, because drupal tested by hundreds of developers in more than 10 000 hours, than your code with 1 people in less than 100 hours :)

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