Answer the question
In order to leave comments, you need to log in
Handlebars - how to render template output in template?
Here is approximately the following code, I get an array with Ajax and form a Handlebars template, then I do the same with other data and form a second template.
$.ajax({
url: "/node/88",
success: function(json){
var data = jQuery.parseJSON(json);
var templ_in = Handlebars.compile( $('#templ_in').html() );
$('#block_1').append( templ_in(data) );
}
}).done(function send(){
$.ajax({
url: '/node/15',
success: function(json){
var data = jQuery.parseJSON(json);
var templ_second = Handlebars.compile( $('#templ_second').html() );
$('#block_1').append( templ_second(data) );
...
{{#each post}}
{content}
{{/each}}
{{#each post}}
{content}
{{> 2ой шаблон}}
{{/each}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question