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

Adding one more CSS if the *.html.twig is loaded

Started by Muut Archive 10 years ago · 1 replies · 408 views
10 years ago

Good day.
We have base.html.twig with {% block stylesheets %}, when the template part is loaded, we need to add additional css to {% block stylesheets %}. So we have in the base.html.twig

---yaml
{% block stylesheets %}
{% do assets.addCss('theme://css/materialize.min.css',100) %}
{% endblock %}
{{ assets.css() }}

TWIG
and in the page.html.twig
---yaml
{% embed 'partials/base.html.twig' %}
{% block stylesheets %}
   {% do assets.addCss('theme://css/slick.css',64,top) %}
{% endblock %}
{% endembed %}

The result is that the css in the base is fully replaced by the css from page.html.twig. Actually we need to add, not to replace. What am i doing wrong?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1366 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1124 9 years ago