New to Drupal (using drupal 8) .. please bear with me.. I 've tried to find an answer, but I couldn't...
I have created a content type, say 'course' that holds info about a particular course. I have successfully created and placed a twig template, node--course.html.twig and through there I can control the layout of all dynamically created courses.
So far so good .. However, that course is linked to a simple taxonomy (entity reference) which has only two terms, say 'theoretical' and 'classical'. Say that this value is held within field_course_direction.
Now the problem .. When I output any course I use my node--course.html.twig and somewhere I have something like:
Direction: {{ content.field_course_direction }}
So I get the appropriate value (say 'classical') as a link, which points to a view of all courses under 'classical'.
The problem is - that page which is something like 'my-site.com/taxonomy/term/37' for me, again uses the node--course.html.twig template, and as a result comes up really weird with some HTML stuff I dont want there.
I have enabled twig debug, and in the HTML source I indeed see the 'X' next to the template .. But why is that happening? What does this have to do with my 'course' content type? Why is that template being picked up? Is it because of the relationship between them? ...
I 'm quite confused .. Obviously I haven't understood how templates should be named and used, but still I can't get why that view has anything to do with a specific template such as node--MY_CONTENT_TYPE.html.twig ....
Thanks a lot for your patience and time ..
PS - I could replace my code with something like:
Direction: {{ node.field_course_direction.entity.label }}
and thus get only the 'raw' value, in this case a simple string saying 'Classical' without the link, but this is not what I want/ask .. I ask why is that template being picked up by a page that seems completely irrelevant to me ...