Reputation: 4611
if i am browsing a page of taxonomy in drupal, is there a way to get term-id of this page??
ex:
select * from 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 i browse the page of Cyprus, how can i get its tid??
Upvotes: 0
Views: 3522
Reputation: 4611
Thanks...
i got the answer, it is arg(2)
in other words
if (arg(0) == 'taxonomy' && is_numeric(arg(2))) {
return arg(2);
}
else
return FALSE;
}
Upvotes: 2