Author Fields into a content type template I'm trying to load some of the information from the author into a node--article.html.twig. So I can provide some information like bio, social media,etc.

Similar to this...



I can easily get the author_name and the author_picture because these two are given by the template. I added extra field at admin/config/people/accounts/fields in this case the only extra field is field_bio



I try to use the include to add this user field into.

node--article.html.twig

&lt;h4&gt;{{ author_name }}&lt;/h4&gt;
&lt;p&gt;{% include('field--user--field-bio--user.html.twig') %}&lt;/p&gt;


This what I have on the field template - field--user--field-bio--user.html.twig 

&lt;span{{ attributes }}&gt;
  {%- for item in items -%}
      {{ item.content }}
  {%- endfor -%}
&lt;/span&gt;

&lt;p&gt;Hello&lt;/p&gt;


The word "Hello" is been display on the node--article.html.twig; however, the item.content which is my field information is not been load. =(

I also try to dig up into the user variables by using {{ kint() }} to see if there is this information and I did not find it either.

I have seen some example with a module, which I have avoid them because this is for a contrib theme and I do not want to have any module dependency. I have done this many times with DS but I do not want to use any extra module.

So I have couple questions...


Should I use include for this use case or not ? 


If I have too, what I'm doing wrong ? Why the item.content is not been load ?
If I should not use it in this use case, what should I do instead ?
Should I use include for this use case or not ?


This is not possible, you can't mix different templates like node and field because they have different variables.


  If I have too, what I'm doing wrong ? Why the item.content is not been
  load ?


item.content is only loaded in field, not in node template.


  If I should not use it in this use case, what should I do instead ?


You should define the user field you need in preprocess, examples for the two fields already defined:

function template_preprocess_node(&amp;$variables) {
  $variables['author_name'] = drupal_render($variables['elements']['uid']);
  $variables['author_picture'] = user_view($node-&gt;getOwner(), 'compact');


A basic example to use this in your own hook:

function mytheme_preprocess_node(&amp;$variables) {
  $node = $variables['node'];
  $variables['user_field1'] = $node-&gt;getOwner()-&gt;field_field1-&gt;value;


And in twig

{{ user_field1 }}