title: DjangoCMS Sekizai {% render_block "js" %} disable usage of jQuery
body: <p>I'm working on DjangoCMS app, which includes its custom javascript file, but I have a problem with using jQuery after using templatetag render_block.</p>
  
  <p>After creating a new project here is my project structure:</p>
  
  <pre><code>project/
      apps/
          myapp/
      static/
          js/
              custom.js
      templates/
          base.html
          header.html
          menu.html
      __init__.py
      settings.py
      urls.py
  </code></pre>
  
  <p><strong>base.html</strong></p>
  
  <pre><code>{% load cms_tags menu_tags sekizai_tags staticfiles %}
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;{% block title %}This is my new project home page{% endblock title %}&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          {% include "header.html" %}
          {% show_menu 0 100 100 100 "menu.html" %}
       &lt;/div&gt;
      {% block content %}{% endblock content %}
      {% render_block "js" %}
      {% addtoblock 'js' %}
           &lt;script type='text/javascript' src="{% static "js/bootstrap.min.js" %}"&gt;&lt;/script&gt;
           &lt;script type='text/javascript' src="{% static "js/custom.js" %}"&gt;&lt;/script&gt;
      {% endaddtoblock 'js' %}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>project/apps/myapp/templates/myapp/home.html</strong></p>
  
  <pre><code>{% extends CMS_TEMPLATE %}
  {% load cms_tags sekizai_tags staticfiles %}
  
  {% block title %}Home{% endblock title %}
  {% block content %}{% endblock content %}
  </code></pre>
  
  <p>There is no content in <em>home.html</em>, yet. But the content from base.html renders properly.
  The problem is in <em>custom.js</em> which uses jQuery.</p>
  
  <p><strong>custom.js</strong></p>
  
  <pre><code>$(document).ready(function(){
      alert("Hi");
  });
  </code></pre>
  
  <p>Alert message never pop up, and I get message <em>"undefined is not a function"</em>. <strong>The main problem that bothers me is that jQuery is included in my source code</strong>, but I can't use it. </p>
  
  <p><strong>source code</strong></p>
  
  <pre><code>&lt;html&gt;
  ...
  &lt;body&gt;
      ....
      &lt;script&gt;
      var _jQuery = window.jQuery || undefined;
      var _$ = window.$ || undefined;
      &lt;/script&gt;
      &lt;script src="/static/cms/js/libs/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/libs/class.min.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/jquery.ui.custom.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/jquery.ui.nestedsortable.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/cms.base.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/cms.modal.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/cms.sideframe.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/cms.clipboard.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/cms.plugins.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/cms.structureboard.js"&gt;&lt;/script&gt;
      &lt;script src="/static/cms/js/modules/cms.toolbar.js"&gt;&lt;/script&gt;
      ...
      &lt;script type='text/javascript' src="/static/js/custom.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Obviously {% render_block "js" %} works fine, but I found that because of it, CMS.$ will be passed for $. Because of that I added:</p>
  
  <pre><code>&lt;script&gt; $ = CMS.$ &lt;/script&gt; 
  </code></pre>
  
  <p>on the top of my <code>addtoblock</code>:</p>
  
  <pre><code>{% addtoblock 'js' %}
      &lt;script&gt;$=CMS.$&lt;/script&gt;
      &lt;script type='text/javascript' src="{% static "js/bootstrap.min.js" %}"&gt;&lt;/script&gt;
      &lt;script type='text/javascript' src="{% static "js/custom.js" %}"&gt;&lt;/script&gt;
  {% endaddtoblock 'js' %}
  </code></pre>
  
  <p>My problem with alert was resolved, but Bootstrap still reports that ther is no jQuery:</p>
  
  <blockquote>
    <p>Bootstrap's JavaScript requires jQuery</p>
  </blockquote>
  
  <p>Adding jQuery in <code>addtoblock</code> can resolve the problem, but then there will be two same jQuery files in my source code and that is unnecessary.
  What am I missing here?</p>