是否可以将自定义字段添加到 Drupal 分类术语中?

发布于 2024-08-28 08:19:02 字数 203 浏览 7 评论 0原文

我想在 drupal 分类术语中添加一个日期字段,以及默认的“标题”和“描述”

是否有一些技术/php/模块可以让我做到这一点? 可以用CCK吗?

我需要能够在同一视图中显示新字段,以呈现引用该术语的内容节点。

目前,我已经使用 CCK 将日期字段添加到内容节点,并通过视图显示。但这并不是我想要的,我只想每学期更新一个日期。

I'd like to add a date field to a drupal taxonomy term, alongside the default "title" and "description"

Is there some technique/php/module that lets me do this?
Is it possible to do with CCK??

I need to be able to display the new field in the same view presenting the content nodes referencing the term.

At the moment, I've added a date field to the content nodes with CCK, and it's displayed by the view. But that's not exactly what I'm going for, I just want to update one date per term.

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

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

发布评论

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

评论(3

悟红尘 2024-09-04 08:19:02

Drupal 7 中添加了将字段附加到术语,但这仍处于测试阶段。我建议用 Drupal 6 中的节点参考字段替换您的分类法。

Attaching fields to terms is added in Drupal 7, but that's still beta. I'd suggest replacing your taxonomy with a node reference field in Drupal 6.

柏拉图鍀咏恒 2024-09-04 08:19:02

有一个模块可以做到这一点:术语字段。有关此模块的更多详细信息(来自其项目页面):

术语字段允许您定义分类术语的字段,就像 CCK 允许您定义节点字段的方式一样。

此模块的可能用途

  • 您拥有一个书评网站,您可以在其中使用分类模块按书作者对书评进行分类。您已创建一个列出网站上所有图书作者的视图,但您不仅希望列出作者的姓名,还希望包含一些传记信息,例如作者的出生日期。
  • 您有一个视频游戏粉丝网站,您可以在其中使用所有术语都是游戏的词汇对新闻、评论和图像进行分类。您想要创建网站上所有游戏的索引,但您想要列出游戏的发布日期、发行商和平台,而不是仅仅列出游戏名称。
  • 您有一个食谱网站,其中食谱是节点,并使用词汇表进行分类,其中术语是创建食谱的厨师。同样,您想要列出所有有视野的厨师,但您还想在他们的名字旁边列出他们最喜欢的食谱。

如果分类术语需要的不仅仅是标题和描述,则可以使用术语字段。

There's a module to do exactly this: Term Fields. Some more details about this module (from its project page):

Term Fields allows you to define fields for taxonomy terms in the same way that CCK allows you to define fields for nodes.

Possible uses for this module

  • You own a book review site where you use the Taxonomy module to classify book reviews by the book author. You've created a view that lists all book authors on the site, but instead of just listing the author's name, you'd like to include some biographical information as well, such as the author's date of birth.
  • You have a video game fansite where your classify news, reviews, and images with a vocabulary where all the terms are games. You want to create an index of all games on your site, but instead of just listing the name of the game, you want to list the game's release date, publisher and platform.
  • You have a recipes site where recipes are nodes and are classified with a vocabulary where the terms are the chefs who created the recipes. Again, you want to list all the chefs with a view, but you also want to list their favorite recipe next to their name.

Any situation where taxonomy terms need more than just a title and a description is where Term Fields comes in to use.

江心雾 2024-09-04 08:19:02

正如 Scott 所说,Drupal 7 将此作为核心的一部分。有一些将节点附加到分类的模块(例如 分类节点),查看这些模块可能也会有所帮助。

As Scott said, Drupal 7 has this as part of core. There are some modules that attach nodes to taxonomy (e.g. Taxonomy Node) that might also be helpful to look at.

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