Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Error with assets deferred

Solved by Vadym View solution

Started by Pedro M 4 years ago · 2 replies · 633 views
4 years ago

Hi.

When I try to defer assets with assets.addLink in a stylesheets block, I get the following error:

An exception has been thrown during the rendering of a template ("Property 'link_pipeline_include_externals' does not exist in the object!")

I have a block with:

TWIG
{% block assets deferred %}
    {{ assets.all()|raw }}
{% endblock %}

And in {% block stylesheets %} an entry with {% do assets.addLink('https://fonts.googleapis.com/css?family=Lora:400,400i,700', {rel:'stylesheet'}) %}

What am I doing wrong?
Thanks.

4 years ago Solution

in short, in your approach just use assets.addCss not assets.addLink
like in Clean Blog theme example
{% do assets.addCss('https://fonts.googleapis.com/css?family=Lora:400,400i,700') %}

4 years ago

Tnaks @b.da

I read in the Grav help that addLink "It is useful for adding link tags to the head from anywhere in your site that are not CSS files"

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 23 hours ago
2 40 16 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago