I've been working off of Brian Mann's BackboneRails screencast, so my application structure is totally consistent with those.
The following defines the 'show' portion of a the HomepageApp Marionette Appication.
My.module('HomepageApp.Show', function(Show, App, Backbone, Marionette, $, _){
Show.Photo = Marionette.ItemView.extend({
tagName:'span'
});
Show.Photos = Marionette.CollectionView.extend({
template: 'homepage/show/templates/photos',
itemView:Show.Photo,
itemViewContainer: '#photos'
});
Show.Layout = Marionette.Layout.extend({
template: 'homepage/show/templates/layout',
regions:{
photoRegion: '#photo-region'
}
});
});
I'm also overriding the Marionette.Renderer.render function with the following:
Backbone.Marionette.Renderer.render = function(template, data){
var path = JST["backbone/apps/" + template];
try{
if(!path) throw({message: "Template '" + template + "' not found!"});
return path(data);
}
catch(err){
console.log(err.message);
}
}
All of my views, including many not shown here are working perfectly. The issue is that the 'template' propery of the Show.Photos CollectionView is turning up as 'undefined' in my renderer override giving me the following error:
Template 'undefined' not found!
The odd thing is that this even happens when I pass no value for the template property at all.
I also know that I'm passing it a valid Backbone collection on instantiation.
I'm totally stuck. Anyone familiar with this phenomenon?