How to load taxonomy term by name in Drupal 8

Posted by admin on Fri, 01/19/2018 - 14:57

Code snippet to load taxonomy term by name (or any otehr property) in Drupal 8.

$term_name = 'Your Term Name';
$term = \Drupal::entityTypeManager()
      ->getStorage('taxonomy_term')
      ->loadByProperties(['name' => $term_name]);

If you want to use vid and name - just add that to properties array like this:

$term_name = 'Your Term Name';
$vid = 3;
$term = \Drupal::entityTypeManager()
      ->getStorage('taxonomy_term')
      ->loadByProperties(['name' => $term_name, 'vid' => $vid]);
×

Hey! Don't miss a new cool stuff!

Comments

Canadian viagra 50mg (not verified)

Mjohlw toxlau buy viagra 100mg Buy no rx viagra

inticleni (not verified)

world class casino slots http://onlinecasinofbk.com/ - best online casinos play online casino best online casino

inticleni (not verified)

world class casino slots http://onlinecasinofbk.com/ - best online casinos play online casino best online casino

inticleni (not verified)

world class casino slots http://onlinecasinofbk.com/ - best online casinos play online casino best online casino

inticleni (not verified)

world class casino slots http://onlinecasinofbk.com/ - best online casinos play online casino best online casino

Estherchera (not verified)

Cscczh kxxrki sildenafil coupons Best viagra alternative

inticleni (not verified)

real money casino best online casino gold fish casino slots casino blackjack http://onlinecasinofbk.com/ - casino games

inticleni (not verified)

real money casino best online casino gold fish casino slots casino blackjack http://onlinecasinofbk.com/ - casino games

inticleni (not verified)

real money casino best online casino gold fish casino slots casino blackjack http://onlinecasinofbk.com/ - casino games

inticleni (not verified)

best online casinos http://onlinecasinofbk.com/ - casino play online casinos slots games free play slots online

inticleni (not verified)

best online casinos http://onlinecasinofbk.com/ - casino play online casinos slots games free play slots online

inticleni (not verified)

best online casinos http://onlinecasinofbk.com/ - casino play online casinos slots games free play slots online

inticleni (not verified)

best online casinos http://onlinecasinofbk.com/ - casino play online casinos slots games free play slots online

inticleni (not verified)

hemp cbd http://cbdoilusd.com/ - cbd medic hemp oil cbd store cbd drops

inticleni (not verified)

hemp cbd http://cbdoilusd.com/ - cbd medic hemp oil cbd store cbd drops

Estherchera (not verified)

Riflnn qrjgoi Us discount viagra overnight delivery Us viagra

Estherchera (not verified)

Riflnn qrjgoi Us discount viagra overnight delivery Us viagra

inticleni (not verified)

cbd pills http://cbdoilusd.com/ buy cbd oil cbd store cbd oil at walmart

inticleni (not verified)

cbd pills http://cbdoilusd.com/ buy cbd oil cbd store cbd oil at walmart

inticleni (not verified)

best cbd oil cbd capsules cbd gummies walmart cannabis oil

inticleni (not verified)

best cbd oil cbd capsules cbd gummies walmart cannabis oil

inticleni (not verified)

http://cbdoilusd.com/ hemp oil for pain cbd oil for pain pure cbd oil hemp oil

inticleni (not verified)

cbd oil for sale http://cbdoilusd.com/ buy cbd cbd vape cbd capsules

inticleni (not verified)

cbd oil for sale http://cbdoilusd.com/ buy cbd cbd vape cbd capsules

inticleni (not verified)

http://cbdoilusd.com/ cbd store cbd gummies buy cbd oil online cbd oil for dogs

inticleni (not verified)

cbd oil at walmart http://buycbdoil11.com/ - cannabis oil cbd drops cbd drops

inticleni (not verified)

cbd oil at walmart http://buycbdoil11.com/ - cannabis oil cbd drops cbd drops

inticleni (not verified)

cbd oils http://buycbdoil11.com/ - cbd store cbd cream cbd oil for pain cbd vape

inticleni (not verified)

cbd oils http://buycbdoil11.com/ - cbd store cbd cream cbd oil for pain cbd vape

inticleni (not verified)

http://buycbdoil11.com/ cbd oils http://buycbdoil11.com/ - cbd near me cbd oil

inticleni (not verified)

cbd vape http://buycbdoil11.com/ - cbd gummies cbd cream cbd oil for dogs

inticleni (not verified)

cbd oil for pain http://buycbdoil11.com/ - cbd hemp buy cbd cbd for sale cbd vape

inticleni (not verified)

pure cbd oil buy cbd cbd for dogs hemp oil for pain http://buycbdoil11.com/ - hemp oil for pain

inticleni (not verified)

cbd pills http://cbdoilglk.com/ cbd vape best cbd oil cbd for dogs

inticleni (not verified)

cbd medic cbd oil for pain cbd pills cbd store

inticleni (not verified)

cbd medic cbd oil for pain cbd pills cbd store

inticleni (not verified)

cbd medic cbd oil for pain cbd pills cbd store

inticleni (not verified)

cbd medic cbd oil for pain cbd pills cbd store

inticleni (not verified)

medterra cbd http://cbdoilglk.com/ - cbd oil for pain cbd for sale cbd oil benefits

inticleni (not verified)

cbd for sale http://cbdoilglk.com/ - hemp cbd oil cbd for dogs buy cbd oil online cbd oil

inticleni (not verified)

http://buycbdoilwalm.com/ cbd gummies walmart http://buycbdoilwalm.com/ - cbd store cbd

inticleni (not verified)

http://buycbdoilwalm.com/ cbd gummies walmart http://buycbdoilwalm.com/ - cbd store cbd

inticleni (not verified)

http://buycbdoilwalm.com/ hemp cbd oil cbd drops best cbd oil cbd gummies walmart

inticleni (not verified)

buy cbd oil online hemp oil cbd gummies cbd oil benefits http://buycbdoilwalm.com/ - cbd cream

inticleni (not verified)

pure cbd oil medterra cbd cbd pure cbd oil online

inticleni (not verified)

pure cbd oil medterra cbd cbd pure cbd oil online

inticleni (not verified)

pure cbd oil hemp cbd oil cbd oil at walmart buy hemp oil

inticleni (not verified)

hemp oil for pain http://buycbdoilwalm.com/ - medterra cbd cbd gummies walmart cbd tinctures

inticleni (not verified)

cbd tinctures cbd cream cbd online cdb oils

inticleni (not verified)

hemp oil http://buycbdoilwalm.com/ - hemp oil hemp oil cannabis oil pure cbd oil

Add new comment