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

enetibliole (not verified)

slot games free casino games slot games online casino

inticleni (not verified)

free slots http://playcasinosw.com/ - online casino online gambling casino online slots free online slots

inticleni (not verified)

free slots http://playcasinosw.com/ - online casino online gambling casino online slots free online slots

enetibliole (not verified)

gold fish casino slots world class casino slots casino games online casino

enetibliole (not verified)

gold fish casino slots world class casino slots casino games online casino

inticleni (not verified)

online slots http://playcasinosw.com/ slot games online casinos free slots

inticleni (not verified)

online slots http://playcasinosw.com/ slot games online casinos free slots

inticleni (not verified)

online slots http://playcasinosw.com/ slot games online casinos free slots

enetibliole (not verified)

casino real money http://casinoplaysw.com/ - slots free gold fish casino slots free casino games online slots games free

enetibliole (not verified)

casino real money http://casinoplaysw.com/ - slots free gold fish casino slots free casino games online slots games free

inticleni (not verified)

casino real money free casino games vegas casino slots cashman casino slots http://playcasinosw.com/ - free casino slot games

inticleni (not verified)

casino real money free casino games vegas casino slots cashman casino slots http://playcasinosw.com/ - free casino slot games

enetibliole (not verified)

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

enetibliole (not verified)

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

inticleni (not verified)

http://playcasinosw.com/ online casinos online casino games cashman casino slots casino online

inticleni (not verified)

http://playcasinosw.com/ online casinos online casino games cashman casino slots casino online

enetibliole (not verified)

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

enetibliole (not verified)

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

inticleni (not verified)

http://playcasinosw.com/ play casino online casino games online casino real money free casino games

inticleni (not verified)

http://playcasinosw.com/ play casino online casino games online casino real money free casino games

enetibliole (not verified)

world class casino slots http://casinoplaysw.com/ online slot games free slots games online casino bonus

inticleni (not verified)

free online slots play slots casino online no deposit casino http://casinoslotspc.com/ - play slots online

enetibliole (not verified)

casino play online slot games online casino bonus casino play http://casinoplaysw.com/ - play slots

enetibliole (not verified)

casino play online slot games online casino bonus casino play http://casinoplaysw.com/ - play slots

inticleni (not verified)

http://casinoslotspc.com/ online slot games casino bonus codes real casino slots world class casino slots

enetibliole (not verified)

free casino slot games real casino slots play slots online free casino slot games http://casinoplaysw.com/ - slot games

enetibliole (not verified)

free casino slot games real casino slots play slots online free casino slot games http://casinoplaysw.com/ - slot games

inticleni (not verified)

casino games casino online slots online casinos

inticleni (not verified)

casino games casino online slots online casinos

Canadian pharma... (not verified)

Dvfjqw kjvtug sildenafil citrate 100mg Viagra next day

Canadian pharma... (not verified)

Dvfjqw kjvtug sildenafil citrate 100mg Viagra next day

enetibliole (not verified)

best online casino free casino games online no deposit casino online gambling

inticleni (not verified)

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

inticleni (not verified)

cashman casino slots online casino games best online casinos free casino

inticleni (not verified)

cashman casino slots online casino games best online casinos free casino

enetibliole (not verified)

http://casinoplaysw.com/ world class casino slots play slots casino bonus codes casino play

enetibliole (not verified)

http://casinoplaysw.com/ world class casino slots play slots casino bonus codes casino play

Usa pharmacy viagra (not verified)

Ryxjjq xtccgu viagra purchase online Levitra or viagra

inticleni (not verified)

real casino slots http://casinoslotspc.com/ - vegas casino slots real money casino play online casino slots games free

inticleni (not verified)

real casino slots http://casinoslotspc.com/ - vegas casino slots real money casino play online casino slots games free

inticleni (not verified)

real casino slots http://casinoslotspc.com/ - vegas casino slots real money casino play online casino slots games free

enetibliole (not verified)

play slots vegas casino slots gold fish casino slots

inticleni (not verified)

http://casinoslotspc.com/ casino online casino play online gambling slots games

enetibliole (not verified)

http://casinoplaysw.com/ free online slots casino slots online gambling free casino games

enetibliole (not verified)

http://casinoplaysw.com/ free online slots casino slots online gambling free casino games

inticleni (not verified)

http://casinoslotspc.com/ casino game http://casinoslotspc.com/ - online casino real money online casino bonus

inticleni (not verified)

http://casinoslotspc.com/ casino game http://casinoslotspc.com/ - online casino real money online casino bonus

enetibliole (not verified)

http://casinogamespqr.com/ play slots online casino bonus codes gold fish casino slots slots online

inticleni (not verified)

free casino slot games http://casinoslotspc.com/ - real casino slots real casino slots casino real money slots for real money

enetibliole (not verified)

http://casinogamespqr.com/ world class casino slots online casino bonus world class casino slots real casino slots

Add new comment