Перейти к содержанию
  • Individual Font Awesome Icons without extra plugins


    MrHaim

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

    1066202515_FAunicode.png.87975f8bae81cc7c0a3f1a6b5b7513e7.png.1f91840dbeba45389bf937b11f853f71.png

     

    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.

     

    784073314_FAcustom.thumb.png.19688b0a76450e2539c61b4fafc7bf2c.png.60824db468d2bf22f79915dd41f20982.png

     

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

    1995497781_FAuntersuchen.png.1510f6c6d199015a0915b4a15138798e.png.c8c45b98a5f1914e7ddf360119598cf7.png

     

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

    1128701363_FAdemo.thumb.png.beb834c192dd8bb11a782ccbabf06c44.png.be415c2b9b32307267b15a4b795e0513.png


    Обратная связь

    Рекомендуемые комментарии

    Комментариев нет



    Присоединяйтесь к обсуждению

    Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.
    Примечание: Ваш пост будет проверен модератором, прежде чем станет видимым.

    Гость
    Добавить комментарий...

    ×   Вставлено с форматированием.   Вставить как обычный текст

      Разрешено использовать не более 75 эмодзи.

    ×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

    ×   Ваш предыдущий контент был восстановлен.   Очистить редактор

    ×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.


×
×
  • Создать...