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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Dump in Twig not outputting anything

Solved by Alexander Kim View solution

Started by Alexander Kim 8 years ago · 6 replies · 4004 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
6 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
6 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 Thomas, 1 week ago
2 51 8 hours ago
Support · by Anna, 2 days ago
2 58 10 hours ago
Support · by Justin Young, 11 hours ago
1 30 11 hours ago
Support · by Duc , 1 week ago
2 63 5 days ago
Support · by Colin Hume, 1 week ago
2 55 5 days ago