简体   繁体   English

我每天的Drupal问题:通过api获取给定词汇表中的所有节点

[英]My daily Drupal question: get all nodes in a given vocabulary trough the api

While you can easily make a query result where vid=vocabularyId I'd like to know if there's a method in the api to do so so my code looks a bit less ugly. 虽然您可以轻松地在vid = vocabularyId中创建查询结果,但我想知道api中是否有方法可以这样做,所以我的代码看起来有点不那么难看。 I'd like to know if theres something like vocabulary_get_nodes(vid) already implemented in Drupal's core. 我想知道是否已经在Drupal的核心中实现了类似于vocabulary_get_nodes(vid)的东西。

Not sure this is exactly what you want to do, but check out these three API functions: 不确定这正是您想要做的,但请查看以下三个API函数:

  1. taxonomy_select_nodes() taxonomy_select_nodes()
  2. taxonomy_render_nodes() taxonomy_render_nodes()
  3. taxonomy_term_page() taxonomy_term_page()

If you search api.drupal.org, there are several other vocabulary related API functions as well, just search for the ones that begin with taxonomy_ 如果您搜索api.drupal.org,还有其他几个与词汇相关的API函数,只需搜索以taxonomy_开头的那些函数。

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

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