a.define('top', { className: 'interview_top_container', content: function(){ return a.create({Div: { className: 'interview_inner_top_container', content: a.create([ this.param.content, {Div: {className: 'cap1'}}, {Div: {className: 'cap2'}} ]) }}) } }); a.define('photo', { className: 'photos_container', content: function(){ console.log('photocontent', this.param.content); var img = this.param.content.shift ? this.param.content.shift() : ''; var desc = this.param.content; return a.create({className: 'photo_container', content: ([{ Div: { className: 'photo_img_container', content: ([ img, {Div: {className: 'cap1'}}, {Div: {className: 'cap2'}} ]) } }, { Div: { className: 'photo_description_container', content: a.create([ {Div: {className: 'jp', content: desc}} ]) } }])}); } }); a.define('article', { className: 'article_container', content: function(){ return (this.param.content); } }); a.define('article_title', { className: 'article_info_container', content: function(){ var con = this.param.content && this.param.content.join ? this.param.content : ['', '']; return a.create([{ Div: {className: 'article_info_title_container', content: con[0]} },{ Div: {className: 'article_info_description_container', content: con[1]} }]) } }); a.define('article_info', a.article, { styles: {fontWeight: 'bold'} }); a.define('author', { className: 'profile_container', content: function(){ return a.create([{ Div: {className: 'profile_border'} }, {Div: {className: 'profile_inner_container', content: (this.param.content)}}]) } }); a.define('end', { className: 'end_container', }); console.log('definedend');