Font Awesome[edit | edit source]
So you want a rocket on your page to show how awesome your stuff is. Something like this: http://fontawesome.io/icon/rocket/
If your wiki supports Font Awesome, then it's as easy as <i class="fa fa-pull-left fa-5x fa-rocket" aria-hidden="true"></i>
That is how to show a Font Awesome icon, pulled to the left, 5x bigger than normal, and explicitly telling screen readers to ignore the item as decorative.
Bootstrap Example[edit | edit source]
One of three columns
Two of three columns
Three of three columns
I love coffee!!!
Cloud deployment means instantly available and scalable. We can also do on-premise / local installations to meet your custom requirements.
All the pieces are put together for you. NO assembly required!
We specialize in
How To[edit | edit source]
Adding Font Awesome used to be an extension that you could install. However, the source is no longer available, except as a GPL-violating purchase with no source; and the link doesn't even work.
/*To add script tags to the page we use load instead of the deprecated importScriptURI */ /* You'll need to visit the fontawesome site to get a KEY to use */ mw.loader.load('//use.fontawesome.com/aldfjsdlkfjdlskf0.js');
I'll check into all the recent details of the 'ResourceLoader' mechanism, and write a new extension or update comments here.
Some would say that you can shim into OutputPage by calling a hook in your LocalSettings.php
But that did not seem effective.
Then there is another extension called mw:Extension:PhpTags_Widgets. That extension looks great (because it comes with stuff like Vega, and for other features too) and was recently updated to FontAwesome 4.5 But installing that has a bunch of dependencies on other extensions by the same author; which are marked experimental; and which go deep into murky waters that are not remotely connected to simply getting FontAwesome in your wiki. In short: Interesting stuff; not the best way to get FontAwesome.
Problems[edit | edit source]
There may be bugs that have to be tracked down with regard to using it on a wiki site. It turns out that Tidy was interfering with FontAwesome by removing the empty tags.
The problems I originally encountered mysteriously disappeared. The main caveat being that FA does not preview. It only shows up on 'Save'. Font Awesome only seems to work if there is an actual image on the page. For example, this is an edit icon from a normal svg file. [[Image:Edit icon.svg|30px]]. Remove that and your Font Awesome icon will disappear. Note: the image file doesn't even have to exist, it's just that the image processing code is not called unless there is a [[File:]] tag in the wikitext. And FA doesn't work if I close the tag properly. The fa element is duplicated throughout the rest of the page since it wasn't closed.
Getting it[edit | edit source]
- Sign up for a unique embed code at the fontawesome website.
- Add the script source to your wiki by editing the MediaWiki:Common.js file where you add a call to 'load' the external script
- Insert the
<i>tags where ever you want. Note that there are various sizes pre-defined as fa-1 (smallest) to fa-6 (largest)
More[edit | edit source]
- Check http://fontawesome.io/examples/
- http://fontawesome.io/icons/ The icons (Note there is a new kickstarter for a Pro product https://www.kickstarter.com/projects/232193852/font-awesome-5)
Other Extensions[edit | edit source]
There is also an older 'bootstrap-mediawiki' extension which uses Bootstrap 3 and FontAwesome 4 https://github.com/borkweb/bootstrap-mediawiki
References[edit | edit source]
- Extension:FontAwesome has been stagnant since 2014 and the developer has been changing around URLs with the current pay link saying it's "out of stock"!? Really, you ran out of source code?