Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

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

Started by Muut Archive 10 years ago · 1 replies · 486 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 2294 9 years ago
Archive · by Muut Archive, 9 years ago
2 1508 9 years ago
Archive · by Muut Archive, 9 years ago
2 4761 9 years ago
Archive · by Muut Archive, 9 years ago
1 3575 9 years ago
Archive · by Muut Archive, 9 years ago
3 1633 9 years ago