Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8895191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:42:41+00:00 2026-06-14T23:42:41+00:00

I’m using MopaBootstrapBundle in Symfony 2.1.3 with Twig templates. This bundle has base.html.twig template

  • 0

I’m using MopaBootstrapBundle in Symfony 2.1.3 with Twig templates.
This bundle has base.html.twig template which contains scripts block:

{% block foot_script %}
    {# To only use a subset or add more js overwrite and copy paste this block
    To speed up page loads save a copy of jQuery in your project and override this block to include the correct path
    Otherwise the regeneration is done on every load in dev more with use_controller: true
     #}
    {% javascripts
        'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-transition.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-modal.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-dropdown.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-scrollspy.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-tab.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-tooltip.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-popover.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-alert.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-button.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-collapse.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-carousel.js'
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-typeahead.js'
        '@MopaBootstrapBundle/Resources/public/js/mopabootstrap-collection.js'
        '@MopaBootstrapBundle/Resources/public/js/mopabootstrap-subnav.js'
    %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock foot_script %}

I’m extending it in my template using:

{% extends 'MopaBootstrapBundle::base.html.twig' %}
{% block foot_script %}{% endblock foot_script %}

But it still tries to load Bundle’s base.html.twig template and I get:

An exception has been thrown during the compilation of a template
(“Unable to find file
“@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-transition.js”.”)
in “MopaBootstrapBundle::base.html.twig”.


What I’ve found out is, that if you extend it like this:

{% extends 'MopaBootstrapBundle::base.html.twig' %}
{% block foot_script %}
    {% javascripts
        '@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-typeahead.js'
        '@MopaBootstrapBundle/Resources/public/js/mopabootstrap-collection.js'
        '@MopaBootstrapBundle/Resources/public/js/mopabootstrap-subnav.js'
    %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock foot_script %}

Note the typeahead.js

I get:

An exception has been thrown during the compilation of a template
(“Unable to find file
“@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-typeahead.js”.”)
in “MopaBootstrapBundle::base.html.twig”.

If I remove just one line:

{% extends 'MopaBootstrapBundle::base.html.twig' %}
{% block foot_script %}
    {% javascripts
        '@MopaBootstrapBundle/Resources/public/js/mopabootstrap-collection.js'
        '@MopaBootstrapBundle/Resources/public/js/mopabootstrap-subnav.js'
    %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock foot_script %}

I get:

An exception has been thrown during the compilation of a template
(“Unable to find file
“@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-transition.js”.”)
in “MopaBootstrapBundle::base.html.twig”.

It still tries to load all the scripst from base template.

Any suggestions how to override *foot_script* block to make it empty and not to load these JS files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:42:43+00:00Added an answer on June 14, 2026 at 11:42 pm

    What you want is to embed the MopaBootstrapBundle::base.html.twig instead of extending it. You should use Twig’s embed tag:

    {% embed 'MopaBootstrapBundle::base.html.twig' %}
        {% block foot_script %}{% endblock foot_script %}
    {% endembed %}
    

    From Twig’s documentation:

    The embed tag combines the behaviour of include and extends. It allows you to include another template’s contents, just like include does. But it also allows you to override any block defined inside the included template, like when extending a template.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have an array which has BIG numbers and small numbers in it. I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.