sorry for the basic question,

I have a Twig template with a View outputting a custom content type, with Format set to show fields..

I have debugged with Kint, but I can't see a fields array anywhere in the output.

How do I get the fields from my custom content type to show in the view?


enter image description here


You will need to add the fields to the view display using the Views UI, like here: admin/structure/views/view/content/edit/page_1

If you look at the default "Content" view, you'll see fields like title, type, author, etc. Click "Add" then find the field you're looking for.

There are some great learning resources such as: https://drupalize.me/series/introduction-views-drupal

  • Thanks! I have already added the fields to the view though. – jim Jan 8 at 14:10
  • You can override the default "views-view-fields.html.twig" file with your custom version, placed in your theme, call it "views-view-fields--VIEW_MACHINE_NAME.html.twig", or some other variation based on display/etc. If you haven't overridden anything yet and just aren't seeing the output, I expect it's in the view config for those panel fields. – ben.hamelin Jan 9 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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