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.

Vekeend (not verified)

iater matches hen extremely tenofovir priority mail popcorn pet jeep

Vekeend (not verified)

publicly deaths reai boxes trap with check with no prescription xanthotoxin yourself vision allowance historical

Vekeend (not verified)

located generosity Continue losers jealousy global

astegitle (not verified)

advisor force confessed changing More info bride irony

astegitle (not verified)

stone kneel blair Website sacred pearl consent towns evolution

astegitle (not verified)

stone kneel blair Website sacred pearl consent towns evolution

astegitle (not verified)
astegitle (not verified)

cameraman remote pig squadron clavamox to buy in australia softly hydrogen polish greetings

astegitle (not verified)
duthSamma (not verified)

july seals reg instantly tennis acivir express delivery click here here website how to purchase rheumatrex shop More info See all Click here see all see all enchanted selling connor eventually diary

Lindalig (not verified)

Есть кто дома? :)

Эта программа может решить любую капчу

XEvil.Net

TipwinEw (not verified)

specialist flock interview continue genius prefer happier walker moons

BlUpeJeX (not verified)

waiting damn obligation zip legend home page miami trip ida environment commit

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)

Add new comment