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

NathanMon (not verified)

best sex cam site adultfreewebcamsites.com best shemale cam sites.

NathanMon (not verified)

best sex cam site adultfreewebcamsites.com best shemale cam sites.

NathanMon (not verified)

sex web cam spy cam sex free asian sex cam.

NathanMon (not verified)

free webcam girls girl live web cam cam girl search.

NathanMon (not verified)

xxx cam sex hidden cam sex videos security cam sex.

NathanMon (not verified)

hot cam girls camgirls1.com girls masturbate hidden cam.

NathanMon (not verified)

hot cam girls camgirls1.com girls masturbate hidden cam.

NathanMon (not verified)

webcam sex show bestonlinesexwebcams wedding night sex hidden cam.

NathanMon (not verified)

best cam site adultfreewebcamsites.com new webcam sites.

NathanMon (not verified)

real nanny cam sex bestonlinesexcams1.com chat sex cam.

NathanMon (not verified)

couple cam sites shemale webcam sites jasmin cam site.

NathanMon (not verified)

lesbian cam girls camgirls1.com free cam chat with girls.

enetibliole (not verified)

online gambling http://casinorealmoneysoe.com/ real casino slots online casino real money slots for real money

enetibliole (not verified)

online gambling http://casinorealmoneysoe.com/ real casino slots online casino real money slots for real money

enetibliole (not verified)

free slots http://onlinecasinogamespcx.com/ - online gambling free casino free slots casino play

enetibliole (not verified)

free slots http://onlinecasinogamespcx.com/ - online gambling free casino free slots casino play

enetibliole (not verified)

free slots http://onlinecasinogamespcx.com/ - online gambling free casino free slots casino play

enetibliole (not verified)

big fish casino http://onlinecasinogamespcx.com/ - casino real money free slots slots games vegas casino slots

enetibliole (not verified)

big fish casino http://onlinecasinogamespcx.com/ - casino real money free slots slots games vegas casino slots

enetibliole (not verified)

big fish casino [url=http://onlinecasinogamespcx.com/ ]casino real money [/url] free slots slots games vegas casino slots

enetibliole (not verified)

casino blackjack http://onlinecasinogamespcx.com/ - free casino vegas casino slots casino games

enetibliole (not verified)

casino games http://onlinecasinogamespcx.com/ - online casino slots free slots casino online play slots

enetibliole (not verified)

casino games http://onlinecasinogamespcx.com/ - online casino slots free slots casino online play slots

enetibliole (not verified)

casino games http://onlinecasinogamespcx.com/ - online casino slots free slots casino online play slots

inticleni (not verified)

casino play online casino real money real casino slots

enetibliole (not verified)

online casinos http://onlinecasinogamespcx.com/ - slots games free online casino real money slots online slots online

enetibliole (not verified)

online casinos http://onlinecasinogamespcx.com/ - slots games free online casino real money slots online slots online

inticleni (not verified)

free online slots http://onlinecasinosw.com/ - online casino real money play slots online slots free

enetibliole (not verified)

free casino games casino play online slots free casino games

Jtkhkt b (not verified)
enetibliole (not verified)

slot games http://onlinecasinogamespcx.com/ - slots online slots free world class casino slots free slots

enetibliole (not verified)

slot games http://onlinecasinogamespcx.com/ - slots online slots free world class casino slots free slots

inticleni (not verified)

casino bonus codes online casino real money free casino slot games online casino games

inticleni (not verified)

casino bonus codes online casino real money free casino slot games online casino games

enetibliole (not verified)

casino game http://onlinecasinogamespcx.com/ - casino game slots online casino blackjack

enetibliole (not verified)

casino game http://onlinecasinogamespcx.com/ - casino game slots online casino blackjack

inticleni (not verified)

http://onlinecasinosw.com/ slots for real money http://onlinecasinosw.com/ - play slots online real money casino

inticleni (not verified)

http://onlinecasinosw.com/ slots for real money http://onlinecasinosw.com/ - play slots online real money casino

enetibliole (not verified)

online casinos http://onlinecasinogamespcx.com/ casino games free casino games online online casinos

inticleni (not verified)

play online casino play online casino casino online

inticleni (not verified)

play online casino play online casino casino online

inticleni (not verified)

play online casino play online casino casino online

enetibliole (not verified)

real casino slots casino play online casino real money best online casinos http://onlinecasinogamespcx.com/ - slots games

inticleni (not verified)

slots games best online casino casino slots free casino games online

inticleni (not verified)

slots games best online casino casino slots free casino games online

enetibliole (not verified)

slots for real money http://onlinecasinogamespcx.com/ - online gambling slots online slots online

inticleni (not verified)

http://onlinecasinosw.com/ slot games http://onlinecasinosw.com/ - casino online free slots games

inticleni (not verified)

http://onlinecasinosw.com/ slot games http://onlinecasinosw.com/ - casino online free slots games

enetibliole (not verified)

free casino games casino game free slots slots online

inticleni (not verified)

free online slots free casino slot games online slot games

Add new comment