简体   繁体   English

drupal taxonomy术语返回别名的路径

[英]drupal taxonomy term path to return alias

Taxonomy term path: 分类术语路径:

http://api.drupal.org/api/function/taxonomy_term_path http://api.drupal.org/api/function/taxonomy_term_path

Returns the unaliased path. 返回未混淆的路径。 I used pathauto to give the term alias, how can I return the aliased version? 我使用pathauto给术语别名,我该如何返回别名版本?

Thanks. 谢谢。

使用drupal_get_path_alias()

$path_alias = drupal_get_path_alias(taxonomy_term_path($term) );

you may want to explore the url() function as well. 你可能也想探索url()函数。 I use it all of the time with node ids. 我一直使用节点ID。

$node_href = url('node/'.$nid);

although you probably want something like: 虽然你可能想要这样的东西:

$term_href = url('taxonomy/term/' . $tid);

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

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