how can i get term id of a page in drupal? -
if browsing page of taxonomy in drupal, there way term-id of page??
ex:
select * term_data limit 2; +-----+-----+--------------------------+-------------+--------+----------+------+ | tid | vid | name | description | weight | language | trid | +-----+-----+--------------------------+-------------+--------+----------+------+ | 24 | 1 | central african republic | | 0 | en | 0 | | 26 | 1 | cyprus | | 0 | en | 0 | +-----+-----+--------------------------+-------------+--------+----------+------+
if browse page of cyprus, how can tid??
thanks...
got answer, arg(2)
- arg(0) ==> returns "taxonomy"
- arg(1) ==> returns "term"
- arg(2) ==> returns tid
in other words
if (arg(0) == 'taxonomy' && is_numeric(arg(2))) { return arg(2); } else return false; }
Comments
Post a Comment