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)

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

enetibliole (not verified)

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

enetibliole (not verified)

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

inticleni (not verified)

http://casinoslotspc.com/ online casinos casino real money world class casino slots online casino slots

inticleni (not verified)

http://casinoslotspc.com/ online casinos casino real money world class casino slots online casino slots

enetibliole (not verified)

vegas slots online big fish casino slots online online casino http://casinogamespqr.com/ - casino blackjack

inticleni (not verified)

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

enetibliole (not verified)

casino real money best online casinos play slots online

enetibliole (not verified)

casino real money best online casinos play slots online

inticleni (not verified)

http://casinoslotspc.com/ free slots http://casinoslotspc.com/ - casino slots casino games

Brand viagra (not verified)

Ynvwdc wtxsrt canadian viagra online pharmacy Buy discount viagra

enetibliole (not verified)

casino real money http://casinogamespqr.com/ - free casino slot games free online slots best online casino casino blackjack

enetibliole (not verified)

casino real money http://casinogamespqr.com/ - free casino slot games free online slots best online casino casino blackjack

inticleni (not verified)

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

enetibliole (not verified)

vegas casino slots play slots online real casino slots

inticleni (not verified)

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

enetibliole (not verified)

http://casinogamespqr.com/ no deposit casino online slot games big fish casino casino online slots

enetibliole (not verified)

http://casinogamespqr.com/ no deposit casino online slot games big fish casino casino online slots

enetibliole (not verified)

http://casinogamespqr.com/ no deposit casino online slot games big fish casino casino online slots

inticleni (not verified)

http://casinorealmoneyfdr.com/ casino online http://casinorealmoneyfdr.com/ - slots games casino bonus codes

Best price for ... (not verified)

Ycrzyc wxgqik Real viagra without prescription Buy discount viagra

enetibliole (not verified)

online casino bonus http://casinogamespqr.com/ - slots games free real money casino free online slots online slots

enetibliole (not verified)

online casino bonus http://casinogamespqr.com/ - slots games free real money casino free online slots online slots

inticleni (not verified)

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

inticleni (not verified)

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

enetibliole (not verified)

casino blackjack http://casinogamespqr.com/ - big fish casino best online casinos slots free gold fish casino slots

inticleni (not verified)

free slots http://casinorealmoneyfdr.com/ vegas casino slots world class casino slots slot games

inticleni (not verified)

free slots http://casinorealmoneyfdr.com/ vegas casino slots world class casino slots slot games

enetibliole (not verified)

online casino slots casino blackjack casino real money

inticleni (not verified)

http://casinorealmoneyfdr.com/ play online casino http://casinorealmoneyfdr.com/ - free casino games online online casino gambling

Order viagra usa (not verified)

Njqodr xkqfow Buy viagra now online Buy viagra in us

enetibliole (not verified)

play casino casino bonus codes best online casinos

inticleni (not verified)

casino games real money casino play online casino free slots

enetibliole (not verified)

online casino real money online casino online casino bonus casino play

Add new comment