- Issue created by @dmudie
- πΊπΈUnited States dmudie
I ended up generating options like this but please comment if there is a better way. Thanks.
$term_options = []; $terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree('vid-name',0,NULL,TRUE); foreach ($terms as $term) { $termId = $term->id(); if($term->parent->target_id) { $term_options[$termId] = new CshsOption($term->getName(),$term->parent->target_id); } else { $term_options[$termId] = new CshsOption($term->getName()); } }
- πΊπΈUnited States jeffschuler Boulder, Colorado
Thanks @dmudie! This was really helpful.
I still wonder if there's a cleaner way to do this.