Get Taxonomy Term ID by Node in Drupal 8 -


i'm trying taxonomy data particular node.

how can taxonomy term id using node object ?

drupal ver. 8.3.6

you that:

$termid = $node->get('field_yourfield')->target_id; 

then can load term with

term::load($termid); 

hope helps.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -