I am not a expert developper therefore I am not able to understand in the documentation of the assets plugin where the assets has to be written in the example …
Wouldn’t it be possible to change documentation a lit bit to make it more clear?
I mean: with the examples, I understand what it does … but I don’t know where I should place it?
Is it in the header of the markdown file of a page? …
In its body? …
In the base.html.twig ? …
Elsewhere? …
Its seems very powerful, but the examples are minimals…
I would like to know more to be able to understand the full power of it…
@tidivoit To make the answer short Assets plugin allows you to add (inline) CSS and/or JS directly from your page content. Just for example in a page you write
{assets:css}
custom-style.css
{/assets}
to include a style file called custom-style.css into the page in the same folder as the page is located.
nothing.
+ Even adding to new line `base.html.twig` like:
{% block javascripts %}
{% do assets.addJs(‘jquery’,101) %}
{% do assets.addJs(‘theme://js/modernizr.custom.71422.js’,100) %}
{% do assets.addJs(‘theme://js/featherlight.min.js’) %}
{% do assets.addJs(‘theme://js/clipboard.min.js’) %}
{% do assets.addJs(‘theme://js/jquery.scrollbar.min.js’) %}
{% do assets.addJs(‘theme://js/learn.js’) %}
{% do assets.addJs('theme://js/helloworld.js') %}
{{ assets.js() }}
{% endblock %}
does not work here.
There must be something wrong.... but what?
For the moment, I am dealing with TWIG passing every script in `.html.twig` extensions, but it is not really serious...
Any advice welcome.