No output from kint in twig templates

Created on 18 November 2023, about 1 year ago
Updated 13 December 2023, 12 months ago

I installed and enabled Devel Kint Extras.

On the page with the path /admin/config/development/devel I specified Kint as variables dumper.

Below is part of the code of one of the twig templates in use.

<div class="layout-content">
      {{ kint(page.content) }}
</div>{# /.layout-content #}

Why I'm getting no output from kint?

Thanks in advance!

Andrea

šŸ’¬ Support request
Status

Closed: works as designed

Version

1.1

Component

Miscellaneous

Created by

šŸ‡®šŸ‡¹Italy AppLEaDaY

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

Comments & Activities

  • Issue created by @AppLEaDaY
  • Status changed to Postponed: needs info 12 months ago
  • šŸ‡§šŸ‡ŖBelgium dieterholvoet Brussels

    I just tried adding the snippet you mentioned to the page.html.twig template of my theme and it works, tested using Drupal 10.1.5. Are you sure you're changing the right template? You should check the page source and look for this kind of comment, it will show you what template is being used:

    <!-- BEGIN OUTPUT from 'themes/custom/xxxx/templates/page.html.twig' -->
    
  • šŸ‡®šŸ‡¹Italy AppLEaDaY

    @DieterHolvoet I just acted in page.html.twig. There I have the code below.

    <div class="container mt-3 mb-3">
      {{ kint(page.content) }}
    </div>
    

    I know for sure from the theme debug that page.html.twig is in use.

    The related output follows.

    <div class="container mt-3 mb-3">
          
    </div>
    

    What else should I check?

    Thanks in advance!

    Andrea

  • šŸ‡§šŸ‡ŖBelgium dieterholvoet Brussels
    • Are you sure page.content actually contains anything? Do you get something when you put {{ kint(_context) }}?
    • Are you sure Twig debugging is enabled? Check the debug key under twig.config in your services.yml file.
  • šŸ‡®šŸ‡¹Italy AppLEaDaY

    @DieterHolvoet, please have a look at the screenshot.
    As you can see, debug is enabled. And page.content must contain something, since, after I replace kint(page.content) with page.content the content appears.
    I'm puzzled.

    Thanks in advance!

    Andrea

  • šŸ‡§šŸ‡ŖBelgium dieterholvoet Brussels

    I have no idea. Does it work if you uninstall Devel Kint Extras? If it still doesn't work, you should report this issue in the Devel project ā†’ .

  • šŸ‡®šŸ‡¹Italy AppLEaDaY

    @DieterHolvoet, I did what you suggested, and it still didn't work. Though I didn't expect that kint was coming with Devel, and not with Devel Kint Extras... Are you sure about that? I've just read the description for Devel Kint Extras, but maybe I didn't get correctly what explained there...

  • Status changed to Closed: works as designed 12 months ago
  • šŸ‡§šŸ‡ŖBelgium dieterholvoet Brussels

    Yes, Iā€™m sure. Devel provides Kint and Devel Kint Extras changes a couple things about the configuration of Kint, as explained in the project description. If the problem is still present without this module, Iā€™m afraid this module is not the cause. I suggest having a look at the Devel issue queue.

Production build 0.71.5 2024