1

I'm having a problem in my html.html.twig file where the styles and scripts variables are not printing anything, and when I debug with dump:

{{ dump(styles) }}  
{{ dump(scripts) }}

Both variables are empty and 'NULL' is returned.

Any suggestions on how to debug this further?

4

Those variables have been changed in beta16/RC1.

See HTML template head, scripts, styles and scripts_bottom replaced with placeholder_token:

Before

{{ head }}
{{ styles }}
{{ scripts }}
{{ scripts_bottom }}

After

<head-placeholder token="{{ placeholder_token|raw }}">
<css-placeholder token="{{ placeholder_token|raw }}">
<js-placeholder token="{{ placeholder_token|raw }}">
<js-bottom-placeholder token="{{ placeholder_token|raw }}">

The markup should be stable now with RC1, but when you're having trouble with a custom template, always compare it with the core default markup in the module providing it and/or the classy theme.

0

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.