Changes

Jump to navigation Jump to search
471 bytes added ,  13:18, 17 November 2016
no edit summary
== How To ==
Adding Font Awesome used to be an extension that you could install<ref>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?</ref>. However, the source is no longer available, except as a GPL-violating purchase with no source; and the link doesn't even work.
 
The best way I've found is to modify [[MediaWiki:Common.js]], but I ran into [[#Problems]] with that too.
<source lang=javascript>
/*To add <script src="https://use.fontawesome.com/14c71d3de0.js"></script>
we use load instead of the deprecated importScriptURI */
mw.loader.load('//use.fontawesome.com/14c71d3de0.js');
</source>
 
I'll check into all the recent details of the '[https://www.mediawiki.org/wiki/ResourceLoader ResourceLoader]' mechanism, and write a new extension or update comments here.
Some would say that you can shim into [https://doc.wikimedia.org/mediawiki-core/master/php/classOutputPage.html 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]]. But installing that caused a fatal error in my wiki that I didn't have time to debug. Another way to add a script is to modify That extension looks great (because it comes with stuff like [[MediaWikihttps:Common//vega.js]github.io/vega/ Vega], but I ran into [[#Problems]] with that and for other features too) and was recently updated to FontAwesome 4.5<source lang=javascriptref>/*To add <script src="https://usegerrit.fontawesomewikimedia.comorg/14c71d3de0.js"><r/script> we use load instead of the deprecated importScriptURI *#/mw.loader.load('q/project:mediawiki/use.fontawesome.comextensions/14c71d3de0.js');PhpTagsWidgets,n,z</sourcerefBut installing that caused a fatal error in my wiki that Ididn'll check into all the recent details of the '[https://www.mediawiki.org/wiki/ResourceLoader ResourceLoader]' mechanism, and write a new extension or update comments heret have time to debug.
=== Problems ===
But there is a dependency and some There may be bugs that have to be tracked down with regard to using it on a wiki site. # The problems seem to have I originally encountered mysteriously disappeared with the . The main caveat being that the icon FA does not preview. It only shows up on 'Save'.# <strike>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. <nowiki>[[Image:Edit icon.svg|30px]]</nowiki>. 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 <nowiki>[[File:]]</nowiki> tag in the wikitext.</strike># <strike>And FA doesn't work if I close the tag properly. </strike># <strike>The '''fa''' element is duplicated throughout the rest of the page since it wasn't closed. </strike>
# https://stackoverflow.com/questions/tagged/font-awesome
# https://github.com/FortAwesome/Font-Awesome
 
== Other Extensions ==
There is also an older 'bootstrap-mediawiki' extension which uses Bootstrap 3 and FontAwesome 4
https://github.com/borkweb/bootstrap-mediawiki
[[Category:Wiki]]
[[Category:QualityBox]]
4,558

edits

Navigation menu