Module:File link/doc
< Module:File link
This is a documentation subpage for Module:File link.
It contains usage information, categories and other content that is not part of the original module page.
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
This module depends on the following other modules:
This module is used to construct wikitext links to files. It is primarily useful for templates and modules that use complicated logic to make file links. Simple file links should be made with wikitext markup directly, as it uses less resources than calling this module. For help with wikitext file markup please refer to the documentation at mediawiki.org.
Usage from wikitext
From wikitext, this module should be called from a template, usually {{file link}}. Please see the template page for documentation. However, it can also be called using the syntax
{{#invoke:File link|main|arguments}}
.
Usage from Lua
First, you need to import the module.
local mFileLink = require('Module:File link')
Then you can make file links using the _main function.
mFileLink​.​_main​(​args​)
args is a table of arguments that can have the following keys:
To see the effect of each of these parameters, see the images help page on mediawiki.org.
Examples
With the file only:
mFileLink.main{file = 'Example.png'}-- Renders as [[File:Example.png]]
With format, size, link and caption options:
mFileLink.main{ file = 'Example.png', format = 'thumb', size = '220px', link = 'Wikipedia:Sandbox', caption = 'An example.'}-- Renders as [[File:Example.png|thumb|220px|link=Wikipedia:Sandbox|An example.]]
With format, size, and border:
mFileLink.main{ file = 'Example.png', format = 'frameless', size = '220px', border = true}-- Renders as [[File:Example.png|frameless|border|220px]]

Last edited on 20 November 2020, at 00:01
Wikipedia
Content is available under CC BY-SA 3.0 unless otherwise noted.
Privacy policy
Terms of Use
Desktop
 Home Random  Nearby  Log in  Settings  Donate  About Wikipedia  Disclaimers
WatchEdit