Extension:FileLink ParserFunction
|
FileLink_ParserFunction Release status: beta |
|
|---|---|
| Implementation | Parser function |
| Description | highlights links to local filesystem |
| Author(s) | Matheus Garcia (Matheus GarciaTalk) |
| Last version | 0.1 |
| MediaWiki | tested on 1.15.1 |
| License | GPL |
| Download | Project page |
|
Check usage (experimental) |
|
Contents |
[edit] Description
This extension is widely based on Extension:FileProtocolLinks, but implemented using parser functions instead of tags.
I´ve created it because tag-based extensions seems to not be easily integrated with Semantic MediaWiki, and I needed to use this extension to output value of semantic properties.
Please note that tag-based extensions can be called as parser functions using the workaround described Manual:Tag_extensions#Extensions_and_Templates here. This enables Extension:FileProtocolLinks to work without problem with Semantic MediaWiki, and makes this extension unnecessary.
[edit] Example
To create a link to a file, eg. c:\whatever\foo.txt, just type:
{{#file: c:\whatever\foo.txt}}
Note you can use this to output semantic properties. If you have, for example, a property path defined in a template, it can be rendered as a link in any pages that use it if template code includes the code:
{{#file: {{{path}}} }} [[path::{{{path}}}| ]]
[edit] Installation
The source code is hosted on [github] and versioned using the [git] tool (not SVN, as most of the extensions). So, you'll need git to download ou update the sources.
Once git is installed, you can download the extension issuing the following command in the extensions/ directory:
git clone http://github.com/mgbf/FileLink_ParserFunction.git
That would create directory FileLink_ParserFunction/, which contains the needed files, right under extensions/.
After that you just need to include the following line in LocalSettings.php:
require_once("$IP/extensions/FileLink_ParserFunction/FileLink_ParserFunction.php");
[edit] Issues
Please note that this extension may not work with some browsers for security reasons (See here)
