开发者

drupal taxonomy term path to return alias

开发者 https://www.devze.com 2022-12-16 11:10 出处:网络
Taxonomy term path: http://api.drupal.org/api/function/taxo开发者_运维百科nomy_term_path Returns the unaliased path. I used pathauto to give the term alias, how can I return the aliased version?

Taxonomy term path:

http://api.drupal.org/api/function/taxo开发者_运维百科nomy_term_path

Returns the unaliased path. I used pathauto to give the term alias, how can I return the aliased version?

Thanks.


Use drupal_get_path_alias()

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


you may want to explore the url() function as well. I use it all of the time with node ids.

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

although you probably want something like:

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

精彩评论

暂无评论...
验证码 换一张
取 消