{"action":"created","issue":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/761","labels_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/761/labels{/name}","comments_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/761/comments","events_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/761/events","html_url":"https://github.com/bem/bem-forum-content-ru/issues/761","id":122239581,"number":761,"title":"bemhtml. Не получается пробросить контент","user":{"login":"karalkou","id":15378911,"avatar_url":"https://avatars.githubusercontent.com/u/15378911?v=3","gravatar_id":"","url":"https://api.github.com/users/karalkou","html_url":"https://github.com/karalkou","followers_url":"https://api.github.com/users/karalkou/followers","following_url":"https://api.github.com/users/karalkou/following{/other_user}","gists_url":"https://api.github.com/users/karalkou/gists{/gist_id}","starred_url":"https://api.github.com/users/karalkou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karalkou/subscriptions","organizations_url":"https://api.github.com/users/karalkou/orgs","repos_url":"https://api.github.com/users/karalkou/repos","events_url":"https://api.github.com/users/karalkou/events{/privacy}","received_events_url":"https://api.github.com/users/karalkou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/bemhtml","name":"bemhtml","color":"bfe5bf"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/bemjson","name":"bemjson","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-15T10:24:59Z","updated_at":"2015-12-15T13:04:51Z","closed_at":null,"body":"В bemjson-файле описания страницы есть блоки .event-line и .article-preview.\r\nВнутри .article-preview используется .event-line.\r\nНе получается передать содержимое из bemjson в bemhtml.\r\nВсе, до чего додумался уже проверил. Если у кого есть время, посмотрите, пожалуйста. Может подскажете, где проблема.\r\n\r\nbemjson\r\n```js\r\n{\r\n    block: 'event-line',\r\n    event: {\r\n        date: {\r\n            content: '19.11.2015',\r\n            visibilityMod: { visibility: true }\r\n        },\r\n        city: {\r\n            content: 'Ростов-на-Дону',\r\n            visibilityMod: { visibility: true }\r\n        },\r\n        place: {\r\n            content: 'Конгресс-отель \"Амакс\"',\r\n            visibilityMod: { visibility: true }\r\n        },\r\n        type: {\r\n            content: '',\r\n            visibilityMod: { visibility: false }\r\n        }\r\n    }\r\n}\r\n```\r\n...\r\n```js\r\n{\r\n    block: 'article-preview',\r\n    /*attrs: { style: 'display:none;' },*/\r\n    mods: { color: 'white' },\r\n    mix: [{ block: 'row' }],\r\n\r\n    logoWrap: {\r\n        mix: [\r\n            { block: 'col-md-offset-1' },\r\n            { block: 'col-md-3' }\r\n        ],\r\n    },\r\n\r\n    logo: {\r\n        url: '/img/stories/autor-logo.jpg',\r\n        mix: { block: 'article-preview', elem: 'img', elemMods: { size: 'm' } },\r\n        mods: { circle: true, responsive: true },\r\n    },\r\n\r\n    title: {\r\n        content: 'Продвижение себя: строим личный бренд',\r\n        mix: { block: 'title', mods: { 'main-page': 'screen'} },\r\n        mods: {}\r\n    },\r\n    /* description of block .event-line */\r\n    event: {\r\n        date:{\r\n            content: '12.11.2015',\r\n            visibilityMod: { visibility: true }\r\n        },\r\n        city: {\r\n            content: 'Ростов-на-Дону',\r\n            visibilityMod: { visibility: false }\r\n        },\r\n        place: {\r\n            content: '',\r\n            visibilityMod: { visibility: false }\r\n        },\r\n        type: {\r\n            content: 'Вебинар',\r\n            visibilityMod: { visibility: true }\r\n        },\r\n    },\r\n    /* the end of .event-line description */\r\n    text: {\r\n        content: 'Почему об одном бизнесмене пишут СМИ и даже книги, приглашают на конференции, ' +\r\n        'у него спрашивают совета и хотят с ним сотрудничать, а о другом нет, при прочих равных вводных? ' +\r\n        'В деле персональный бренд.',\r\n        mix: { block: 'font', mods: { 'family': 'robotothin'} },\r\n        mods: {}\r\n    },\r\n\r\n    button: {\r\n        content: 'Подробнее',\r\n        mix: { block: 'article-preview', elem: 'btn' },\r\n        mods: { color: 'red-transparent', 'main-page': 'large' }\r\n    }\r\n}\r\n```\r\narticle-preview.bemhtml\r\n```js\r\nblock('article-preview')(\r\n\tcontent()(function(){\r\n\t\treturn [\r\n\t\t\t{\r\n\t\t\t\telem: 'logo-wrap',\r\n\t\t\t\tmix: this.ctx.logoWrap.mix ? this.ctx.logoWrap.mix : {},\r\n\t\t\t\tcontent:\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tblock: 'img',\r\n\t\t\t\t\t\tmix : this.ctx.logo.mix ? this.ctx.logo.mix : {},\r\n\t\t\t\t\t\tmods : this.ctx.logo.mods ? this.ctx.logo.mods : {},\r\n\t\t\t\t\t\turl: this.ctx.logo.url\r\n\t\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tblock: 'col-md-7',\r\n\t\t\t\tcontent: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tblock: 'article-preview',\r\n\t\t\t\t\t\tmix : this.ctx.title.mix ? this.ctx.title.mix : {},\r\n\t\t\t\t\t\telem: 'title',\r\n\t\t\t\t\t\telemMods : this.ctx.title.mods ? this.ctx.title.mods : {},\r\n\t\t\t\t\t\tcontent: this.ctx.title.content\r\n\t\t\t\t\t},\r\n\t\t\t\t\t/*----------------------------------------------------------*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t block: 'event-line',\r\n\t\t\t\t\t event:\r\n\t\t\t\t\t \t{\r\n\t\t\t\t\t \t\tdate:  [\r\n\t\t\t\t\t \t\t\t{\r\n\t\t\t\t\t \t\t\t\tcontent:       this.ctx.event.date.content,\r\n\t\t\t\t\t \t\t\t\tvisibilityMod: this.ctx.event.date.visibilityMod\r\n\t\t\t\t\t \t\t\t}\r\n\t\t\t\t\t \t\t],\r\n\t\t\t\t\t\t\tcity:  [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tcontent:       this.ctx.event.city.content,\r\n\t\t\t\t\t\t\t\t\tvisibilityMod: this.ctx.event.city.visibilityMod\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\tplace: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tcontent:       this.ctx.event.place.content,\r\n\t\t\t\t\t\t\t\t\tvisibilityMod: this.ctx.event.place.visibilityMod\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\ttype:  [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tcontent:       this.ctx.event.type.content,\r\n\t\t\t\t\t\t\t\t\tvisibilityMod: this.ctx.event.type.visibilityMod\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\t/*----------------------------------------------------------*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tblock: 'article-preview',\r\n\t\t\t\t\t\tmix : this.ctx.textMix ? this.ctx.textMix : {},\r\n\t\t\t\t\t\telem: 'text',\r\n\t\t\t\t\t\telemMods : this.ctx.text.mods ? this.ctx.text.mods : {},\r\n\t\t\t\t\t\tcontent: this.ctx.text.content\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tblock: 'btn',\r\n\t\t\t\t\t\tmix : this.ctx.button.mix ? this.ctx.button.mix : {},\r\n\t\t\t\t\t\tmods: this.ctx.button.mods ? this.ctx.button.mods : {},\r\n\t\t\t\t\t\tcontent: this.ctx.button.content\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t]\r\n\t})\r\n)\r\n```\r\nevent-line.bemhtml\r\n```js\r\nblock('event-line')(\r\n    content()(function(){\r\n        return [\r\n           {\r\n               elem: 'date',\r\n               elemMods: this.ctx.event.date.visibilityMod,\r\n               content:  this.ctx.event.date.content\r\n           },\r\n           {\r\n               elem: 'city',\r\n               elemMods: this.ctx.event.city.visibilityMod,\r\n               mix: { block: 'link', mods: { color: 'white' } },\r\n               content: this.ctx.event.city.content\r\n           },\r\n           {\r\n               elem: 'place',\r\n               elemMods: this.ctx.event.place.visibilityMod,\r\n               mix: { block: 'link', mods: { color: 'white' } },\r\n               content: this.ctx.event.place.content\r\n           },\r\n           {\r\n              elem: 'type',\r\n              elemMods: this.ctx.event.type.visibilityMod,\r\n              mix: { block: 'link', mods: { color: 'white' } },\r\n              content: this.ctx.event.type.content\r\n           }\r\n      ];\r\n    })\r\n\r\n)\r\n```\r\narticle-preview.deps.js\r\n```js\r\n([\r\n    {\r\n        mustDeps: [\r\n            { block: 'event-line'},\r\n            { block: 'event-line', elem: 'item' },\r\n            { block: 'event-line', elem: 'city'},\r\n            { block: 'event-line', elem: 'date'},\r\n            { block: 'event-line', elem: 'place'},\r\n            { block: 'event-line', elem: 'type' }\r\n        ]\r\n    },\r\n    {\r\n        shouldDeps: [\r\n            { block: 'btn' },\r\n            { block: 'img'},\r\n            {\r\n                elems: [\r\n                    { elem: 'logo' },\r\n                    { elem: 'text' },\r\n                    { elem: 'title' },\r\n                    { elem: 'button' }\r\n                ]\r\n            }\r\n        ]\r\n    }\r\n])\r\n```\r\nevent-line.deps.js\r\n```js\r\n({\r\n    shoudDeps: [\r\n        { elems: [\r\n            { elem: 'item' },\r\n            { elem: 'city' },\r\n            { elem: 'date' },\r\n            { elem: 'place' },\r\n            { elem: 'type' }\r\n        ]}\r\n    ]\r\n})\r\n```"},"comment":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/comments/164757385","html_url":"https://github.com/bem/bem-forum-content-ru/issues/761#issuecomment-164757385","issue_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/761","id":164757385,"user":{"login":"karalkou","id":15378911,"avatar_url":"https://avatars.githubusercontent.com/u/15378911?v=3","gravatar_id":"","url":"https://api.github.com/users/karalkou","html_url":"https://github.com/karalkou","followers_url":"https://api.github.com/users/karalkou/followers","following_url":"https://api.github.com/users/karalkou/following{/other_user}","gists_url":"https://api.github.com/users/karalkou/gists{/gist_id}","starred_url":"https://api.github.com/users/karalkou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karalkou/subscriptions","organizations_url":"https://api.github.com/users/karalkou/orgs","repos_url":"https://api.github.com/users/karalkou/repos","events_url":"https://api.github.com/users/karalkou/events{/privacy}","received_events_url":"https://api.github.com/users/karalkou/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T13:04:50Z","updated_at":"2015-12-15T13:04:50Z","body":"@tadatuta добрый день)\r\nВ bemjson страницы используются .event-line и .article-preview.\r\n.event-line используется и сам по себе, и внутри .article-preview\r\nЗадумывал как бы пробрасывать контент из bemjson через шаблон article-preview.bemhtml в event-line.bemhtml.\r\nСам event-line.bemhtml работает. Но при сборке .article-preview в поля event-line.bemhtml ничего не приходит\r\n```\r\nblock('event-line')(\r\n    content()(function(){\r\n        return [\r\n           {\r\n               elem: 'date',\r\n               elemMods: this.ctx.event.date.visibilityMod,\r\n               content:  this.ctx.event.date.content ? this.ctx.event.date.content : 'hello, world' /* т.е. на страницу внутри блока .article-preview выводится  hello, world */\r\n           },\r\n           {\r\n               elem: 'city',\r\n               elemMods: this.ctx.event.city.visibilityMod,\r\n               mix: { block: 'link', mods: { color: 'white' } },\r\n               content: this.ctx.event.city.content\r\n           },\r\n           {\r\n               elem: 'place',\r\n               elemMods: this.ctx.event.place.visibilityMod,\r\n               mix: { block: 'link', mods: { color: 'white' } },\r\n               content: this.ctx.event.place.content\r\n           },\r\n           {\r\n              elem: 'type',\r\n              elemMods: this.ctx.event.type.visibilityMod,\r\n              mix: { block: 'link', mods: { color: 'white' } },\r\n              content: this.ctx.event.type.content\r\n           }\r\n      ];\r\n    })\r\n)\r\n```"}}