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)

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

enetibliole (not verified)

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

enetibliole (not verified)

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

enetibliole (not verified)

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

inticleni (not verified)

slots for real money casino game online slots online slots

inticleni (not verified)

slots for real money casino game online slots online slots

inticleni (not verified)

slots for real money casino game online slots online slots

enetibliole (not verified)

http://casinogamespqr.com/ best online casino http://casinogamespqr.com/ - free casino games online no deposit casino

enetibliole (not verified)

http://casinogamespqr.com/ best online casino http://casinogamespqr.com/ - free casino games online no deposit casino

inticleni (not verified)

play casino online slot games free casino games online

inticleni (not verified)

play casino online slot games free casino games online

inticleni (not verified)

play casino online slot games free casino games online

enetibliole (not verified)

slots free http://casinogamespqr.com/ online casino slots no deposit casino vegas casino slots

inticleni (not verified)

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

inticleni (not verified)

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

inticleni (not verified)

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

Brand viagra (not verified)

Jtmkue mbulvd viagra generic price Viagra or cialis

enetibliole (not verified)

slot games vegas casino slots online casino real money big fish casino http://casinogamespqr.com/ - free online slots

Add new comment