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

Adding an applet into a page

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

I would like to insert an applet, but Im not sure how to insert the deployJava javascript source "<script src="//www.java.com/js/deployJava.js"></script>" into the <head> section. Any advice would be appreciated.

10 years ago

If you only want it on one page you can add a line like this to the top of the twig file for that page
- {% block javascripts %} {% do assets.addJs('theme:///js/slick.min.js') %} {% endblock %} -

If you want to add it to every page its a similar change but to your base.html.twig file - add a new line I've done below

TWIG

        {% block javascripts %}
            {% do assets.addJs('jquery', 101) %}
            {% do assets.addJs('java.com/js/deployJava.js', 100) %}
            {% do assets.addJs('theme://js/modernizr.custom.71422.js', 100) %}

        {% endblock %}
        {{ assets.js() }}
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2293 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