Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
vinegredz

Ошибка в настройках IP.Content

Recommended Posts

Все что после Заглушки для гостей можно игнорировать, это мои эксперименты с кодом. Сейчас привел к такому виду все.

<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>

Share this post


Link to post
Share on other sites

Хотя, судя по данным, лучше использовать if/else

{{if \IPS\Member::loggedIn()->inGroup(explode(',', $record->customFieldDisplayByKey('webinars_group_access')))}}
Код для групп, входящих в "webinars_group_access"
{{else}}
Код для остальных
{{endif}}

Share this post


Link to post
Share on other sites

{{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 которая).

Share this post


Link to post
Share on other sites

Еще раз, что выводится из $record->customFieldDisplayByKey('webinars_group_access')? Без дополнительных примесей raw и тд. А лучше для дебагинга используйте {expression="var_dump($record->customFieldDisplayByKey('webinars_group_access'))"}

Share this post


Link to post
Share on other sites

Не знаю что случилось, но все заработало просто когда я не трогал код два дня. Огромное спасибо, в очередной раз спасли.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...