diff --git a/templates/base.twig b/templates/base.twig
index c97e51c7dbf190004116d55b2ac0b40981379a6e..4479d27fba5f57da5b4855e093b78dba7fd91a65 100644
--- a/templates/base.twig
+++ b/templates/base.twig
@@ -6,7 +6,9 @@
     <title>{{ pagetitle }}</title>
     <link rel="stylesheet" type="text/css" href="/{{ baseurlpath }}resources/default.css">
     <link rel="icon" type="image/icon" href="/{{ baseurlpath }}resources/icons/favicon.ico">
-    <link rel="stylesheet" media="screen" type="text/css" href="/{{ baseurlpath }}resources/uitheme1.8/jquery-ui.css">
+    {% if jquery and jquery.css %}
+    <link rel="stylesheet" media="screen" type="text/css" href="/{{ baseurlpath }}resources/uitheme1.8/jquery-ui.css" />
+    {% endif %}
     {% if isRTL %}<link rel="stylesheet" type="text/css" href="/{{ baseurlpath }}resources/default-rtl.css" />{% endif %}
     <meta name="robots" content="noindex, nofollow">
     {% block preload %}{% endblock %}
@@ -28,6 +30,20 @@
 
     <!-- postload javascript -->
     <script type="text/javascript" src="/{{ baseurlpath }}resources/script.js"></script>
+    {% if jquery %}
+    {% set version = '1.8' %}
+    {% if jquery.version %}
+    {% set version = jquery.version %}
+    {% endif %}
+    {% if version = '1.8' %}
+    {% if jquery.core %}
+    <script type="text/javascript" src="/{{ baseurlpath }}resources/jquery-1.8.js"></script>
+    {% endif %}
+    {% if jquery.ui %}
+    <script type="text/javascript" src="/{{ baseurlpath }}resources/jquery-ui-1.8.js"></script>
+    {% endif %}
+    {% endif %}
+    {% endif %}
     {% if clipboard %}
     <script type="text/javascript" src="/{{ baseurlpath }}resources/clipboard.min.js"></script>
     {% endif %}