Answer the question
In order to leave comments, you need to log in
How to display the names of a material with a specific type and the associated subtype name?
Hi All!
Drupal 8.
Neither Drupal, nor Twig, nor PHP's object model is strong. :(
There are materials with the machine name direction. There are materials with the machine name direction_part associated with the direction.
The structure is approximately the following:
Physics
-
Quantum
- Classical
- Relativistic
Chemistry
- Organic
- Inorganic
Biology
- Plants
- Animals
view
This doesn't work.
{% for item in direction %}
{{ item.title }}
{% for subitem in item.direction_part %}
{{ subitem.title }}
{% endfor %}
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question