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 8394971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:11:08+00:00 2026-06-09T20:11:08+00:00

In this coffeescript+backbone.marionette application I am trying to write, I am getting a NoTemplateError:

  • 0

In this coffeescript+backbone.marionette application I am trying to write, I am getting a “NoTemplateError: Could not find template: ‘#second-template’ when I try to display a different view in my content region.

Here are the two pieces of code, which are based on David Sulc’s Backbone Books tutorial. The WelcomeApp displays fine but when I click the menu item that then calls MyApp.SecondApp.display(), I get the NoTemplateError.

window.MyApp = MyApp = new Backbone.Marionette.Application()

MyApp.addRegions
  menu: '#menu'
  content: '#content'

class MyApp.MenuView extends Backbone.Marionette.View
  el: '#menu'

  events:
    'click #get-second': 'showSecond'

  showSecond: ->
    MyApp.SecondApp.display()

MyApp.vent.on 'welcome:rendered', ->
  menu = new MyApp.MenuView()
  MyApp.menu.attachView(menu)


MyApp.WelcomeApp = do ->
  WelcomeApp = {}

  class WelcomeLayout extends Backbone.Marionette.Layout
    template: '#content_welcome-template'

  WelcomeApp.display = ->
    WelcomeApp.layout = new WelcomeLayout()

    WelcomeApp.layout.on 'show', ->
      MyApp.vent.trigger 'welcome:rendered'

    MyApp.content.show MyApp.WelcomeApp.layout

  return WelcomeApp


MyApp.SecondApp = {}

class MyApp.SecondApp.WelcomeView extends Backbone.Marionette.ItemView
  template: '#second-template'

MyApp.SecondApp.display = ->
  welcomeView = new MyApp.SecondApp.WelcomeView()
  MyApp.content.show welcomeView

MyApp.addInitializer ->
  MyApp.WelcomeApp.display()

My templates are simply script blocks in the index.html. I actually swapped the template used by the WelcomeApp with that used by the SecondApp and the WelcomeApp can find ‘#second-template’ fine when I do this.

I tried this with both backbone.marionette 0.9.10 and 0.9.11.

Any help here would be greatly appreciated!

  • 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-09T20:11:09+00:00Added an answer on June 9, 2026 at 8:11 pm

    Thanks to both commenters on my question. While working to strip down the HTML and coffeescript code, I noticed a div in my HTML that was incorrectly closed using <div>. Once I fixed that to a </div> everything worked. Stupid error but I was just not seeing it until I strip down the HTML enough that it was right in my face. I need better syntax checking.

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

Sidebar

Related Questions

I'm trying to create a basic version of this example in CoffeeScript: http://davidsulc.com/blog/2012/04/15/a-simple-backbone-marionette-tutorial/ .
I have this code in Coffeescript window.App = new Backbone.Marionette.Application Models: {} Collections: {}
I try to load image with processing.js using CoffeeScript and write this simple code:
Shouldn't I be able to call this CoffeeScript method from within an erb template?
Spent a solid hour trying to sort out why on earth this (coffeescript) $.ajax
I'm attempting this in coffeescript: $( element ).mousedown( aFunction ).mouseup( anotherFunction ); I'm trying
I'm trying to do exactly this, but with CoffeeScript: # ruby: items.map {|item| item.price
I'm trying to get Jasmine (jasmine-headless-webkit), coffeescript and backbone to work together. I'm close
I am trying to get a CoffeeScript class to extend a Backbone.Model. I built
Im using backbone, require.js and coffeescript in a application. Programming my app, discovered i

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.