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

  • SEARCH
  • Home
  • 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 8087965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:56:47+00:00 2026-06-05T18:56:47+00:00

In my application i added Marionette.sync plugin and override these methods: Backbone.Marionette.TemplateCache.prototype.loadTemplate = function

  • 0

In my application i added Marionette.sync plugin and override these methods:

Backbone.Marionette.TemplateCache.prototype.loadTemplate = function (templateId, callback) {
    var tmpId = templateId.replace("#", ""),
        url = "/app/templates/" + tmpId + ".html";

    $.get(url, function (templateHtml) {
        compiledTemplate = Handlebars.compile($(templateHtml).html())
        callback.call(this, compiledTemplate);
    });
};

Backbone.Marionette.Renderer.renderTemplate = function (template, data) {
    template(data);
};

But this not work, any ideas?

  • 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-05T18:56:50+00:00Added an answer on June 5, 2026 at 6:56 pm

    I assume you’re running v0.9 of Marionette since you mention the Marionette.Async plugin.

    The Renderer change is slightly off in the method name, and nothing is calling your TemplateCache object anymore.

    If you’re intending to use pre-compiled Handlebars functions, then you only need to do this:

    
    Backbone.Marionette.Renderer.render = function(template, data){
      return template(data);
    };
    

    If you intend to have the template loaded asynchronously and then compiled, using the TemplateLoader, your code would need to look like this:

    
    Backbone.Marionette.TemplateCache.prototype.loadTemplate = function (templateId, callback) {
        var tmpId = templateId.replace("#", ""),
            url = "/app/templates/" + tmpId + ".html";
    
        $.get(url, function (templateHtml) {
            compiledTemplate = Handlebars.compile($(templateHtml).html())
            callback.call(this, compiledTemplate);
        });
    };
    
    Backbone.Marionette.Renderer.renderTemplate = function (templateId, data) {
        var renderer = $.Deferred();
        Backbone.Marionette.TemplateCache.get(templateId, function(template){
          var html = template(data);
          renderer.resolve(html);
        });
        return renderer.promise();
    };
    

    The Renderer is responsible for calling the TemplateCache.


    Side note: what article / blog post / wiki page / documentation were you using to get your code from? I have probably missed some pages that need to be updated.

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

Sidebar

Related Questions

In my homeserver management application I added a function to wake PC's remotely via
I added application settings to the project. These settings are saved in 'NameOfMyApp.exe.config'. What
I am building a small Backbone.js application and added some custom getters to one
I've created a new Pylons application and added a controller (main.py) with a template
I created a web service http://service.mydomain.com/MobileService.asmx I created a Windows mobile application I added
In my flex application when I added a tabnavigator control and ran the application,
Everything was going great until I added AddHandler application/x-httpd-php5s .php to the .htaccess file
In a C# Winforms (3.5) application I have added a class that contains many
I'm trying to send an email through the Facebook API. I've added the application
I added a new new application and am trying to use Open Graph 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.