I can't find any resources for this.
I've got a base.twig.html template that all my pages stem from. At the bottom I load the required js for the site: jquery, bootstrap, and some custom javascript
{% block reqscripts %}
{% javascripts '@jquery' '@bootstrap_js' '@sc_js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
{% block extrajs %}
{% endblock %}
The required scripts load and work great!
You'll notice I left an empty "extrajs" block so I can load page specific js if needed.
When I override that block and load other javascript files they throw
$ not defined
jQuery not defined
errors.
Why is this happening and how can I set up my template to handle my extrajs block without jquery errors.
I can show my assetic config if needed but I really doubt that's the problem as jquery is loading just fine.
Edit So the scripts in "extrajs" block actually do execute, but errors are thrown. What is the correct way to do this?
Edit Skeleton for base.html.twig as requested
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
{% block reqstyles %}
{% stylesheets '@SCMainBundle/Resources/public/css/fonts.css' %}
<link rel="stylesheet" href="{{ asset_url }}" screen="media"/>
{% endstylesheets %}
{% stylesheets '@bootstrap_less' %}
<link rel="stylesheet" type="text/css" href="{{ asset_url }}"/>
{% endstylesheets %}
{% block extracss %}
{% endblock %}
{% endblock %}
<title>{% block titleblock %}{% endblock %}</title>
</head>
<body {% block bodyid %}{% endblock %}>
{% block header %}
{% include 'SCMainBundle:Templates/Header:basic-header.html.twig' %}
{% endblock %}
{% block nav %}
{% endblock %}
{% block content %}
{% endblock %}
{% block footer %}
{% include 'SCMainBundle:Templates:footer.html.twig' %}
{% endblock %}
{% block reqscripts %}
{% javascripts '@jquery' '@bootstrap_js' '@sc_js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% block extrajs %}
{% endblock %}
{% endblock %}
</body>
</html>
As you can see, jQuery is loaded first with no error and all files in that javascript block work.
The next block throws missing jquery errors, but still executes the script just fine.