FontAwesome icons

Filters ::: filter_fontawesome
Maintained by FFHS (Fernfachhochschule Schweiz), Christoph Karlen, Sascha Vogel
This filter allows you to use fontawesome icons in the Moodle text editor without worrying about the HTML syntax.
Latest release:
2218 sites
520 downloads
89 fans
Current versions available: 5

Moodle FontAwesome Filter Build Status Coverage Status

Introduction

This filter allows you to use fontawesome icons in the Moodle text editor without worrying about having your div's stripped out by the Moodle Atto/TinyMCE HTML cleaner.

This plugin supports the FontAwesome version (4, 5, 6, ...) that is built into Moodle core or your theme. The plugin does not contain the FontAwesome icon set.

Requirements

Your site/theme must have FontAwesome embedded already. This filter does not provide the font.

  • Moodle 4.1 upwards

Installation

Install the plugin like any other plugin to folder filter/fontawesome

Use git to install this plugin:

cd /var/www/html/moodle
git clone https://github.com/adpe/moodle-filter_fontawesome.git filter/fontawesome


Then complete upgrade over CLI:

sudo -u apache /usr/bin/php admin/cli/upgrade.php

or GUI.

See MoodleDocs] for details on installing Moodle plugins

Configuration

First, activate the filter_tabs plugin in Site Administration -> Plugins -> Filters -> Manage filters

Additional

filter_fontawesome has a settings page to allow you to limit the filter to only certain text-box formats.

Usage

To create FontAwesome icons in text fields, use the following syntax: [fa-*] where * is the name of the icon you wish to display.

First you will need to find the icon you wish to use. This list provides a full overview.

Some examples and guide to start:

  • Anywhere you wish to add an icon just surround it with square brackets and type in the icon name. e.g.: [fa-camera-retro]
  • If the icon name is a brand, please add fab at the beginning of the square brackets.
  • If you wish to make the icon larger you can use a multiplier. e.g.: [fa-camera-retro fa-2x] or [fa-camera-retro fa-4x]
  • If you wish to rotate the icon you can specify how many degrees clockwise. e.g.: [fa-camera-retro fa-rotate-90]
  • You can also flip an icon horizontally or vertically. e.g.: [fa-camera-retro fa-flip-horizontal] or [fa-camera-retro fa-flip-vertical]
  • You can mute the colour to a dull grey. e.g.: [fa-camera-retro fa-muted]
  • You can "pull" the icon to the left or right. If it is "pulled" to the left text will wrap to the right. e.g.: [fa-camera-retro pull-left]
  • All the settings above can be mixed and matched e.g.: [fa-quote-left fa-4x pull-left fa-muted]
  • If some text parts should not be replaced, use <nolink> or <span class="nolink"></span> e.g.: [fa-world] <span class="nolink">[fa-world]</span>

Further information

License

Screenshots

Screenshot #0
Screenshot #1

Contributors

FFHS (Fernfachhochschule Schweiz) (Lead maintainer)
Christoph Karlen: Developer
Sascha Vogel: Developer
Julian Ridden
Julian Ridden: Original author
Usman Asar: Previous maintainer
Adrian Perez Rodriguez: Previous developer
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Usman Asar
    jue, 14 abr 2016, 10:37 AM
    Ricardo, Just made changes to version file, thanks for reporting, please download again.
    Thanks!
  • Ricardo Caiado
    jue, 14 abr 2016, 9:33 PM
    Worked!
  • Matt Townend
    lun, 5 sept 2016, 1:10 PM
    Hey I found that this works fine in text content but not in headings and course names, category names etc. I am using Archaius Theme with added. Anyone else find this problem?
  • Usman Asar
    lun, 5 sept 2016, 5:17 PM
    Matt, you have to do two things
    1: Go into Site administration > Appearance > HTML Settings ---- Default setting is CHECKED for remove HTML tags from all activity names, uncheck that (means you are selecting NO).
    2: Next, go to Plug-Ins > Filters > Manage Filters and in FontAwesome icon filter, select "content & headings" in Apply to section.

    You're done! feel free to fill up headings, section names with icons, I am not still sure about course names if that works there too, but no harm giving a try, if it didn't, try using the exact code from fontawesome rather than filtered code.
  • Renaat
    vie, 18 nov 2016, 2:11 AM
    There is a missing string: update notifications show an error:

    Update notifications

    There is a newer version for some of your plugins available!

    pluginname (filter_fontawesome) There is a new version 2016111700 available!
    Restriction by language (availability_language) There is a new version 2016111600 available!
  • Usman Asar
    vie, 18 nov 2016, 6:43 AM
    Reenat, I have updated plug-in without any issues, have you not tried updating it? if it is not working then try uninstalling and re-installing the plug-in.
  • Ricardo Caiado
    sáb, 19 nov 2016, 12:24 AM
    Hi,

    On the "Description" tab the text "To learn how to add this Font to your moodle site read this blog post." send us to a broken link.

    Ricardo
  • Usman Asar
    sáb, 19 nov 2016, 3:41 AM
    Ricardo, that blog-post was in ownership of Julien, and I assumed he has kept it running, but seems like he removed his site all together, but dont worry, I will update a post soon on my own blog explaining how to use FontAwesome icon filter. Will update you once I have uploaded the post.
  • Joël Schmid
    jue, 1 dic 2016, 8:39 PM
    Does someone have the same problem and is not able to use the new icons provided in FontAwesome version 4.7? Is there a GitHub project for this filter where I could create an issue?
  • Usman Asar
    vie, 2 dic 2016, 12:53 AM
    Joel, is your theme updated with FontAwesome 4.7 as well?
  • Joël Schmid
    vie, 2 dic 2016, 8:47 PM
    @Usman Asar, thats it! I Had to change the CDN Link in the "Additional HTML" Settings (Dashboard / ▶︎ Site administration / ▶︎ Appearance / ▶︎ Additional HTML) to the newest version: Thank you for your help!
  • Raymon Akbar
    jue, 8 dic 2016, 9:00 AM
    I wonder that can I install this plugin in any themes? Such as academi or etc from theme directory in Moodle.org since I read from the description:

    "If you are using a FontAwsome equipped theme (like Essential, Elegance, Adaptable, Shoehorn, Shoelace, BCU, Bootstrap, Flexibase, Pioneer, UIKit, Evolve-D etc) then this filter will allow you to use FontAwesome icons in your content using the easy syntax rather than typing the whole font embed code."

    And I can't find the detail about the other theme. Thank you.
  • Usman Asar
    vie, 9 dic 2016, 10:34 AM
    Raymon, of course you can, use CDN link into the theme of your choice, and it will work with them as well, unlike earlier, where FontAwesome link was publicly available, you have to sign up to their account o get your CDN link (go to www.fontawesome.io) get your CDN link and follow what Joel has mentioned above (putting link in theme header).
    But as well keep in mind, after FontAwesome 5 launch (May 2017), the CDN links may will only be available for a year.
  • Matlabi متلبی
    sáb, 25 ago 2018, 2:34 AM
    Does someone have the same problem and is not able to use the new icons provided in FontAwesome version 4.7? Is there a GitHub project for this filter where I could create an issue?
  • Ricardo Caiado
    mar, 4 sept 2018, 8:30 AM
    Hi,

    Any update to Moodle 3.5?

    Ricardo
Please login to post comments