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

Adding an applet into a page

Started by Muut Archive 10 years ago · 1 replies · 378 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 1362 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