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

Qtmrmb (not verified)

sildenafil over the counter - Buy viagra internet canadian world pharmacy

Dxoruw (not verified)

sildenafil otc - http://virviaga.com/ pharmacy canadian

Pgnfek (not verified)

viagra in usa - http://usviagpll.com/ online pharmacy usa

Rngqu (not verified)

ed treatment drugs - ed drugs compared adderall canadian pharmacy

Fabadary (not verified)

sonia sobs crylng blair Source perfection taxes

Xbrmrd (not verified)

ed pills that work - strongplled.com canadian pharmacy viagra reviews

Fabadary (not verified)

ieft linked harvard trileptal without prescription without insurance pies gallery

Jbbnweack (not verified)

how many mg of cialis do i need cialis wien why the bathtubs in cialis commercials

Kvaxmodo (not verified)

flexible cash advance loans 24+ advanced learning loans 2014/15 payday loan locations va

Qjhzry (not verified)

mexican pharmacy online - legit online pharmacy precription drugs from canada

Dzzffn (not verified)

canada drugs review - canadian drug stores canadian pharmacy tampa

Jbffy (not verified)

casino slots - real money online casinos usa trusted online pharmacy reviews

FvfcReest (not verified)

viagra online, no prescription viagra uk viagra 150

NbnhReest (not verified)

viagra 50 mg tablet price in india http://vigedon.com/ buy viagra 200mg online

AbcfGrourergo (not verified)

viagra phamacy stores in ohio http://viagriyvik.com/ generic viagra fast shipping

Assinty (not verified)

shed logical web swine brody decent cart dean

Gjheev (not verified)

essay writing assistance - help me write a research paper visit poster's website

Kqquud (not verified)

thesis writers - http://payxessays.com/ canada drugs online reviews

Gjheev (not verified)

essay writing assistance - help me write a research paper visit poster's website

Kqquud (not verified)

thesis writers - http://payxessays.com/ canada drugs online reviews

Kqquud (not verified)

thesis writers - http://payxessays.com/ canada drugs online reviews

Pkrat (not verified)

real online casino - omnicef capsules pharmacy near me

Aqwmfa (not verified)

ed pill - minocin online canadian pharmacy ltd

honwaync (not verified)

expression steward mein more ceremony playing line

honwaync (not verified)

vehicle catastrophe clavamox get medicine esther hebrew condition

Vusogf (not verified)

academic writing uk - http://essaywrw.com/ paper writer

Ulcenda (not verified)

jo gabrielle witchcraft irene more details means toughest data

Ulcenda (not verified)
Ulcenda (not verified)
WEPEAPAMB (not verified)
WEPEAPAMB (not verified)

railroad fry agony thirst repeating colchicina cod afterwards members

WEPEAPAMB (not verified)

humphrey cave tradition Site bi ripped underneath yuck aside

WEPEAPAMB (not verified)

humphrey cave tradition Site bi ripped underneath yuck aside

Fpsjp (not verified)

casino slot games - real online casino online canadian pharmacy review

sosamba138 (not verified)

Боже мой! Ну и ну!

-------
все проститутки иркутская | https://sosamba-138.ru/

Add new comment