简体   繁体   English

Drupal:分类术语的其他属性

[英]Drupal: Additional attributes for taxonomy terms

I need to assign dynamic attributes (like entity types) to a custom content type that created. 我需要将动态属性(例如实体类型)分配给创建的自定义内容类型。 Those entity types have a name and 2 additional attributes. 这些实体类型具有名称和2个其他属性。 I've not seen a way to assign additional attributes to a taxonomy term, so I think I shoud use a CCK field and make a reference to it in my main CCK, is it true? 我还没有看到为分类术语指定其他属性的方法,所以我认为我应该使用CCK字段并在我的主CCK中对其进行引用,这是真的吗? I thought that this was a typical use-case for a taxonomy but if I cannot add attributes they are not so useful to me. 我以为这是分类学的典型用例,但是如果我不能添加属性,它们对我来说就没有太大用处。

You could use the Node Auto Term module (or one of the several alternatives, NAT just looks most developed), which (effectively) turns taxonomy terms into nodes, and vocabs into content types. 您可以使用“ 节点自动术语”模块(或NAT看起来最发达的几种替代方法之一),该模块(有效地)将分类术语转换为节点,将词汇表转换为内容类型。 This means you can add fields to the content type using CCK, and effectively add attributes to your terms. 这意味着您可以使用CCK将字段添加到内容类型,并有效地在术语中添加属性。

Note that this module (and the others that perform the same function) just enforces relationships between a vocab and a content type, and terms for that vocab and nodes of that type. 请注意,此模块(以及执行相同功能的其他模块)仅在词汇表和内容类型之间以及该词汇表的术语和该类型的节点之间建立关系。

You can actually achieve the same thing without a module if you don't need automation or enforcement - just create one node per term, tagged with that term, and pull that node into views to access the fields. 如果不需要自动化或强制执行,实际上不需要模块即可实现相同的目的-只需为每个术语创建一个节点,并用该术语标记,然后将该节点拉入视图以访问字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM