====== Drupal 判断当前页面类型 ====== 在Drupal中,分类系统路径都是类似这种格式: taxonomy/term/10 taxonomy/term/17 那么,根据Drupal API,判断当前页面为分类页面,可以这样写: if ( arg(0) == "taxonomy" && arg(1) == "term" ) { echo "这是分类"; } else { echo "这不是分类"; } 类似,节点(node)在drupal内部路径为 node/1, 使用下面的代码可以判断是否为节点(node)。 tid; } if ($terms) $tids = implode('+', $tids); $retArgs[] = $tids; } return $retArgs; ?>