drupal - Display entity reference field values and url using entity query inside twig -


i'm trying figure out how can output values , url of entity reference field values , display them inside twig. here sample of code have constructed. can't seem find out else missing

        // entity query academic experience entity         $academicexperience = $query->get('node')                                     ->condition('status', 1, '=')                                     ->condition('type','programs')                                             ->sort('created')                                     ->execute();          foreach ($academicexperience $key => $academic_menu) {                   $academicnode = _nodeload($academic_menu);               //entity reference field              $variables['academic_menu'][$key]['menu'] = $academicnode->get('field_academic_experience_ref')->value;         }         

                {% academic in academic_menu %}                      <span>{{ academic['menu'] }}</span>                  {% endfor %} 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -