The EAN BarCode generator extension can create a picture of a Code39, Codabar, EAN-13, an EAN-8 or a UPC-A barcode by only adding the EAN-Tags with the barcode number to the article (concerning the EAN/UPC barcode its enough to specify the first 12 (EAN-13), the first 7 (EAN-8) or the first 11 (UPC-A) digits, the following check-digit will be calculated anyway):
For example, the barcode 4007574006243 will be added with the following wiki code to the article: <barcode>4007574006243</barcode>
You can change any barcode to a bigger size by adding the option size=X to the opening tag (X is ofcourse the size-number, like 1 or 2).
You can also use normal image options just like you would with wikipedia images. If you would add an image like this:
[[Image:somepic.jpg|thumb|400px|left|This is some text.]]
the bold part is the part you would add as "options" parameter to the opening tag. For the barcode this would look like the following:
<barcode code="ean" size=1 options="thumb|400px|left|This is some text.">1234567890123</barcode> In live this would produce the following picture:
Since version 2, the pictures are added to your MediaWiki just like any other picture, and therefore, no more used pictures can be found with the "Unused images" special-page and deleted. It also gives you the possibility to arrange the picture more like you want to, just like normal pictures (see the options parameter described above).
With the "code" parameter you define the barcode you want to display. Standard is "EAN-13" but you can also choose EAN-8 (code="ean8") or UPC (code="upc").
And a UPC-A example would be: <barcode code="upc">07928303647</barcode> or <barcode code="upc" size=1>07928303647</barcode> again with a bigger size
Please remember that UPC barcodes must always begin with a zero (0)!
You can play in the Sandbox with the EAN tags by adding any barcode number you like within the EAN tags to the page. You'll see, it works!
EAN extension in zip format (current version: 2.1)
- Unpack the package into your "extensions" subdirectory of your mediawiki installation (you may need to rename the new directory to "ean").
- Add the following line to the bottom of the LocalSettings.php file in your mediawiki home/main directory:
- If you get a warning after the first trying of adding a barcode to an article (something like: no permission) and the picture doesn't appear you will have to do the following: Create the directory "ean" in the subdirectory "images" of your MediaWiki installation and make sure the webserver has reading and writing access to this new directory (in linux you'll have to change the permission of the directory to "0777").