vinegredz Posted October 27, 2015 Author Share Posted October 27, 2015 Все что после Заглушки для гостей можно игнорировать, это мои эксперименты с кодом. Сейчас привел к такому виду все.<div id="webinar_video"> <!--Видят студенты и администратор--> {{if \IPS\Member::loggedIn()->inGroup(explode(',', $record->customFieldDisplayByKey('webinars_group_access')))}} <iframe src="https://login.webinar.fm/ru/login/digitalmakers/light" width="100%" height="433" frameborder="no" allowtransparency></iframe> <div style="position:absolute;top: 20px;right: 56px;"> <div id="fullscreen_button"><i class="fa fa-arrows-alt"></i></div> </div> {{endif}} {$record->customFieldDisplayByKey('webinars_group_access', 'listing')|raw} </div> Link to comment Share on other sites More sharing options...
newbie Posted October 27, 2015 Share Posted October 27, 2015 Хотя, судя по данным, лучше использовать if/else {{if \IPS\Member::loggedIn()->inGroup(explode(',', $record->customFieldDisplayByKey('webinars_group_access')))}} Код для групп, входящих в "webinars_group_access" {{else}} Код для остальных {{endif}} Link to comment Share on other sites More sharing options...
vinegredz Posted October 27, 2015 Author Share Posted October 27, 2015 {{if \IPS\Member::loggedIn()->inGroup(explode(',', $record->customFieldDisplayByKey('webinars_group_access')))}} Код для групп, входящих в "webinars_group_access" {{else}} Код для остальных {{endif}} Последовал Вашему совету, получился вот такой код:<div id="webinar_video"> {{if \IPS\Member::loggedIn()->inGroup(explode(',', $record->customFieldDisplayByKey('webinars_group_access')))}} <iframe src="https://login.webinar.fm/ru/login/digitalmakers/light" width="100%" height="433" frameborder="no" allowtransparency></iframe> <div style="position:absolute;top: 20px;right: 56px;"> <div id="fullscreen_button"><i class="fa fa-arrows-alt"></i></div> </div> {{else}} <div> <div class="no_login_video"> <div style="display:inline-block;vertical-align:middle;"><i class="fa fa-ban"></i> <a target="_blank" href="/login/">Войдите на сайт</a> для просмотра этого вебинара.</div> <div style="display:inline-block;vertical-align:middle;height:100%;width:0px;"></div> </div> </div> {{endif}} </div> Но теперь, всем группам, показывается вторая часть (после else которая). Link to comment Share on other sites More sharing options...
siv1987 Posted October 27, 2015 Share Posted October 27, 2015 Еще раз, что выводится из $record->customFieldDisplayByKey('webinars_group_access')? Без дополнительных примесей raw и тд. А лучше для дебагинга используйте {expression="var_dump($record->customFieldDisplayByKey('webinars_group_access'))"} Link to comment Share on other sites More sharing options...
vinegredz Posted October 30, 2015 Author Share Posted October 30, 2015 Не знаю что случилось, но все заработало просто когда я не трогал код два дня. Огромное спасибо, в очередной раз спасли. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now