Drupal 规则 - 保存时将分类术语的权重作为整数保存到节点的 CCK 字段?
保存节点时,是否可以使用规则将分类术语的数字权重值设置为 CCK 字段?
我有 2 个分类词汇表,并且某种内容类型的所有节点都会有每个词汇表中的 1 个术语。当不在术语页面上时,我需要视图中节点的排序顺序按照术语的权重。因此,我需要将术语的权重作为 CCK 字段访问,以便视图可以使用该值作为排序顺序。这可以通过规则来完成吗?
Is it possible with Rules to set the numeric weight value of a taxonomy term as a CCK field when a node is saved?
I have 2 taxonomy vocabularies, and all nodes of a certain content type will have 1 term from each vocabulary. When not on the term's page, I need the sort order of nodes in a View to be by the term's weight. I therefore need to access the term's weight as a CCK field, so Views can use the value as a sort order. Can this be done with Rules?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
或者您也可以选择行样式作为表格,然后从分类组中选择字段、所有分类术语(也可以按词汇过滤),然后根据该字段对表格进行排序。
编辑:2。在视图中添加一个自定义 php 字段并编写类似
returntaxonomy_term_load($my_tid)->weight;
的内容,然后按此字段对视图进行排序。or you can also select the row style as table and then select the field, taxonomy-terms all(you can filter by vocabulary also) from the taxonomy group and then sort the table based on that field.
EDIT : 2 . Add a custom-php-field in the views and write something like
return taxonomy_term_load($my_tid)->weight;
And then sort the view by this field.