Перейти к содержанию

cyr4x

Актив
  • Постов

    542
  • Зарегистрирован

  • Посещение

  • Победитель дней

    11

Активность репутации

  1. Лайк
    cyr4x отреагировал в MrHaim за запись, Individual Font Awesome Icons without extra plugins   
    In this short tutorial we will show you in step 1 how to decorate the entries in the navigation bar with Font Awesome icons and in step 2 how to replace the status icons of the individual forums. It's actually quite simple, Invision Community supports FA by default and you can find a list of currently supported icons HERE.
    When you find something you want to use, click on it and note the Unicode in the detail view...

     
    Next you go to the list of installed themes in the AdminCP and click on the </> symbol for the theme in which you want to use the icons.
    Then click on the CSS tab and look for the template custom.css, in which an unedited theme should usually only show a placeholder.
     

     
    In order to use FA in navigation, it must first be triggered for this position. This code snippet is responsible for this, which you copy into the empty template...
    .ipsNavBar_primary li > a:before { font-family: "FontAwesome"; line-height: 1; font-weight: normal; } OK, now we know where to get the icons and where to put them. Now we only have to tell the theme where it should display which icon.
    To do this, go back to the frontend, right-click on the element you want to assign an icon to and select Inspect from the context menu, whereupon your browser will present you with something like this...

     
    What interests us in this case is the ID 21. Now copy the following into your template, save it and update your page...
    .ipsNavBar_primary li[id="elNavSecondary_21"] > a:before{content:"\f198"} /* Slack */ Now the element with ID 21 should associate the FA icon with Unicode f198, in this case "Slack". Do the same for all other elements in the top navigation bar. It's the same for subnavigation, only the code is a little bit different...
    .ipsNavBar_secondary li[id="elNavSecondary_10"] > a:before{content:"\f086"} /* Comments */ Now we come to step 2, in which we devote ourselves to the status icons of the forums. You can find out their IDs with a right click, just like those of the elements in the navigation. The code to replace a forum icon is just a bit longer and looks like this...
    .ipsDataItem[data-forumid='2'] .ipsItemStatus.ipsItemStatus_large .fa-comments::before, .ipsItemStatus:not( .ipsItemStatus_large ) .fa-comments::before { content: "\f198"; } The icon with the Unicode f198 is assigned to the forum with the ID number 2, that's pretty much it. When you're done, it might look something like this...

  2. Спасибо
    cyr4x отреагировал в Respected за запись, Онлайн/оффлайн статус в постах   
    Открываем шаблон поста: forums > front > topics > postContainer
    Найти:
    <h3 class='ipsType_sectionHead cAuthorPane_author ipsType_blendLinks ipsType_break'> Добавить после:
    {{if $comment->author()->isOnline()}}<span class="ipsOnlineStatus_online" data-ipsTooltip title="{$comment->author()->name} в сети">On</span>{{else}}<span class="ipsOnlineStatus_offline" data-ipsTooltip title="{$comment->author()->name} не в сети">Off</span>{{endif}} Теперь в custom.css:
    .ipsComment_author .ipsOnlineStatus_online, .ipsComment_author .ipsOnlineStatus_offline { background: #7aa984; color: #fff; padding: 2px 5px; font-size: 11px; border-radius: 3px; position: absolute; left: 6px; top: 6px; } .ipsComment_author .ipsOnlineStatus_offline { background:#ebeff3; color:#788b9c; }  
×
×
  • Создать...