I've got a content type article. I display them on a view blog.

I'm customising the display via views-view-fields--blog.html.twig. I'd like to display the author and date fields (they are configured in the view). The other fields display fine, but how do I access those two?

<div class="blog-article">
  <div class="blog-image">
    <a href="blog-single-right-sidebar.html">{{ fields.field_image.content }}</a>
  <div class="blog-details">
      <!-- Here is where I need the author and date fields -->
      <div class="blog-date">
        Posted by <a href="blog-masonry-2columns.html">{{ ??? }}</a> | {{ ??? }}
      <div class="blog-title">{{ fields.title.content }}</div>
      <div class="blog-short-description">{{ fields.body.content }}</div>
  • Is it not just {{ fields.created.content }}?
    – Kevin
    Commented Feb 13, 2017 at 16:22

1 Answer 1


I've added both node created and node changed fields to my views before, this is how I output them:

<span class="label">Date Created:</span> {{ fields.created.content }}
<span class="label">Date Modified:</span> {{ fields.changed.content }}

I assume user would work the same way. It will render in whatever way the view field is configured.

For example: {{ fields.uid.content }}

  • {{ fields.created.content }} works! What about the author though? How can I check for all these variables?
    – Pim
    Commented Feb 13, 2017 at 16:24
  • Its based on the fields you added to your view output and likely the field name in the view (akin to machine name). So if you relate the user to the node, then add a field called 'User', I suspect the variable is then {{ field.user.content }}.
    – Kevin
    Commented Feb 13, 2017 at 16:25
  • It was {{ field.uid.content }} :-). I could only see the machine name by checking the link with the web inspector in the views admin. Any easier way?
    – Pim
    Commented Feb 13, 2017 at 16:29
  • I believe I hovered on the item in the views config and looked at the browser bar to figure out the name. I suppose you can also debug the incoming variables and figure it out as well with twig xdebug maybe.
    – Kevin
    Commented Feb 13, 2017 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.