How to get values into twig template for fields of type Matrix in Craft CMS 2? CMS: Craft CMS 2
In my admin panel I have globals set called X (under &quot;Globals&quot; from the sidebar and defined in craft_globalsets in the db from Global-&gt;Settings-&gt;New global set).
A field for the field layout for the global set is defined by using as Content a Field type Y of Matrix type with several plain texts fields A,B,C,...
How do I check/show such fields' values (A, B, C, ...) in twig?
What I have tried: I see that in the other parts of the code the handle defined in craft_globalsets (or equivalently in Settings-&gt;Globals) is used to fetch the globals' field value
e.g. for Globals -&gt; set 'K' (handle in craft_globalsets: kHandle) there are several plaintext inputs and such are accessed in twig as:

{{ kHandle.firstField}}

and in fact it works - but when I od the same with set X

{{xHandle.firstFiledInTheMatrix}}

it's null
I have also tried to do

{%  set matrixFields = craft.fields.getFieldByHandle('Y') %}
{{  matrixFields }}

but this returned only the field name.
Perhaps I should do something like {{ xHandle.firstFiledInTheMatrix.getMatrixContent | getFieldContent }} and a for loop on this? (currently guessing the function names here)
You should be able to get your content by using a for loop on your Matrix field:
{% for blocks in kHandle.yourMatrixfieldHandle.all() %}
    {{ block.fieldHandle }}
{% endfor %}

Alternatively, if you only have one block in there, you could use:
{{ kHandle.yourMatrixfieldHandle.first().fieldHandle }}