In a twig, how do I access different fields of a specific content type in a taxonomy term page I have some taxonomy terms like Computer and Accessories, Games, Furniture etc. which I am able to access as /camera-and-accessories, /furniture and so on. These taxonomy terms are associated with my Product content type.

A taxonomy page is always displaying default Product title and Body fields. But I want to customize this page so that it displays additional fields like field_product_price, field_product_photo from my Product content type. I was hoping for something like {{ content.parent }} but I don't think such a thing does not exist (yet!)

Template suggestion by Twig debug

&lt;!-- THEME DEBUG --&gt;
&lt;!-- THEME HOOK: 'taxonomy_term' --&gt;
&lt;!-- FILE NAME SUGGESTIONS:
   * taxonomy-term--1.html.twig
   * taxonomy-term--category.html.twig
   x taxonomy-term.html.twig
--&gt;
&lt;!-- BEGIN OUTPUT from 'themes/custom/ezone/templates/taxonomy-term.html.twig' --&gt;


According to the above output I first overrode default taxonomy-term.html.twig with taxonomy-term--category.html.twig. In taxonomy-term--category.html.twig I did not put anything but just "Hello World!" to check whether this file is being hit. After rebuilding cache the page renders this static text but surprisingly along with that the actual content also got rendered on the page, which I don't know why.

I deleted taxonomy-term--category.html.twig and copied taxonomy-term.html.twig from stable theme to my theme's templates folder. Removed all entries in that file and again tried the same thing with a static text block. Same thing happened again!

Somebody please help with these.
1. How to access fields of a content type on a taxonomy term page
2. Why overridden templates shows taxonomy content when custom template has nothing written in it.

I am sorry if above questions looks stupid or childish. I am a newbie to Drupal.
When you display a taxonomy term the output is produced by this View:

admin/structure/views/view/taxonomy_term

The taxonomy term itself is in the header

HEADER
Global: Rendered entity - Taxonomy term (Global: Rendered entity - Taxonomy term)


and uses the taxonomy term template shown in your question, where you have only access to the fields of the term, not the content.

The format of the content is configured in the main part of the View. Default is to display the content as Teaser:

FORMAT
Format:Unformatted list | Settings
Show:Content | Teaser


If you want to change the fields, you can customize the Teaser in UI:

admin/structure/types/manage/article/display/teaser

Or in this node template (this targets the View, so it would also work, if you changed the view mode):

node--view--taxonomy-term.html.twig

Or switch to a field based View and configure the fields inside of the View.