Using Custom Content Types and Field with Twig

Created on 11 July 2017, almost 8 years ago
Updated 26 March 2025, about 2 months ago

There isn't/wasn't documentation that covered how content created in the UI translated to fields that could be accessed via twig. The linked document (written a while ago) helps to fill that gap:

https://www.drupal.org/docs/8/theming/twig/using-custom-content-types-an...

📌 Task
Status

Needs review

Component

Missing documentation

Created by

🇨🇦Canada rthornton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    Can someone who know Twig verify that the page in the issue summary is up to date and can be added to the menu?

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India snehal-chibde

    hello @quietone, the page in the issue summary looks fine. There are certain corrections which i made to the page.
    Also I would suggest we can have dump function details added to this page.
    ie you can use dump in Twig templates if Twig debugging is enabled.
    {{ dump(variable_name) }}

  • 🇮🇳India adwivedi008

    Hello @snehal and @quitone
    Its better if we add that by simply adding {{dump( )}} you can print all available variables in the twig and then can use it further

Production build 0.71.5 2024