Answer the question
In order to leave comments, you need to log in
Dust template engine: images from css are not loaded after inserting a template
All hello.
The project structure is as follows:
backbone - MVC
Dust -
Mootools template engine - operations with DOM
LESS - CSS generation
Actually, the essence is this. I load via JSON and compile using the dust template. Then, using mootools, I insert it into the page:
new Request.JSON({url: 'templates/basis.json',
onFailure: function(){
console.log('error');
},
onSuccess: function(responseJSON){
dust.loadSource(dust.compile(responseJSON.basis, "intro"));
dust.render("intro", {name: "Fred"}, function(err, out) {
$('init').set('html', out);
return out;
});
}).get();
Answer the question
In order to leave comments, you need to log in
Try adding "!important" to the background image loading. Possibly override existing styles.
Perhaps an error with a relative path to the image .. If you register an absolute, does it work?
In general, the problem turned out to be my inattention. It's a pity that I spent so much time on this, because initially I was looking in the wrong place.
In fact, the problem was in the css: an attribute from another block (background-position: 0 80px;) was accidentally transferred, due to which the image was not visible. Everything turned out to be stupid. =) If I had immediately paid attention to this, I would have saved a few hours ...
And everything else works with a bang, as expected. =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question