Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Dump in Twig not outputting anything

Solved by Alexander Kim View solution

Started by Alexander Kim 8 years ago · 6 replies · 4259 views
8 years ago

How can i check in Twig contents of page object?

Tried in a twig template to call:

TWIG
{{ dump(page) }}

But nothing happened. I've turned on Debug under Twig.

👍 1
8 years ago

Hi
Do you also have the debug bar running? You need to enable debugging and also twig debugging to see anything. The option is in the admin - configuartion - system - Debugger - Debugger -> yes

or in system.yaml

YAML
debugger:
  enabled: true
8 years ago

It's true, i have that panel at the bottom, but it's empty either.

8 years ago

Try this:

{{ dump('i am just a string') }}

if that string is not shown in debuger, then maybe that twig file is not used to display your page.

8 years ago Solution

It was because debugbar injects system jquery, so i have double jquery libs. Switched to system's jQuery and everything works.

👍 1
last edited 03/28/18 by Alexander Kim
7 years ago

I had a similar problem. The DebugBar/Clockwork messages just showed "CENSORED" where the dump should be. After tracing the code I discovered a setting in system.yaml/debugger: censored: true that is not exposed in the admin panel. Setting this to false made it all work.

👍 1
7 years ago

Ah! It is exposed but the prompt is backwards. The admin panel prompt is Show sensitive data, suggesting setting it to yes will show more, but its the opposite. Setting it to yes sets censored: true which suppresses dump output.

Suggested topics

Topic Participants Replies Views Activity
Support · by Paul Hodges, 6 days ago
13 216 2 hours ago
Support · by gtx, 4 days ago
2 125 3 days ago
Support · by Anna, 2 weeks ago
9 300 3 days ago
Support · by TomW, 1 week ago
4 164 6 days ago
Support · by Anna, 1 week ago
4 172 7 days ago