Su is tired and I know I saw this before, but Google is not helping me create a one-page WP core theme. Data is only wordpress JSON API data, and I happily used the basic scheme for several projects, but this time it does not play well. He does this (showing html tags, not ... using them well):
here's the rendering code:
this.template = '<div class="post-list">{{#posts}}<article><h2>{{title}}</h2><span class="postcontent">{{content}}</span></article>{{/posts}}</div>'; if(this.model.get("rawdata").posts!=undefined && this.model.get("rawdata").posts.length>0) { var posts = []; for(i=0;i<this.model.get("rawdata").posts.length;i++) { posts[i] = new PostModel(this.model.get("rawdata").posts[i]); } this.postCollection = new PostCollection(posts); this.htm = Mustache.render(this.template,this.model.get("rawdata")); this.$el.empty().html(this.htm); log(this.htm) } else {
source share