Fandom Developers Wiki
Advertisement

Creates links and changes wikitext when it detects external links.


Syntax[]

Creating a simple link[]

{{#invoke:links|main|<page>|<label>|type = <ext>}}

Creating a batch of links[]

{{links|<batch>|<page/url label type>|<page1 label1 type1>|<page2 label2 type2>|separator = <separatortext>|delimiter = <delimitertext>}}

Parameter description[]

  • Page (mandatory) = url, e.g. http://google.com or Lua .
  • label (optional)= label for the link
  • type (optional)= "ext" for external links

Examples[]

 {{#invoke:links|main|fandom.com|Fandom|type=ext}}

Fandom
 {{#invoke:links|main|w:Help:Lua}}

w:Help:Lua
{{#invoke:links|main|http://wikipedia.org}}

[1]
{{#invoke:links|batch|http://wikipedia.org > Wikipedia|luamods > List of Lua Modules|delimiter=>}}

Wikipedia List of Lua Modules

Module information

Functions

p.link

This function generates a wiki link.
Parameters
NameTypepurpose
urlstringThe url to convert to wikitext.
descstringThe caption or description of the url.
typstringThe type of link, (local or ext).
Return typeReturn purpose
stringA formated wikilink.

p.main

Entry point for function that generates a wiki link.
Parameters
NameTypepurpose
frametableContains frame from invoked module.
Return typeReturn purpose
stringA formated wikilink.

p.batch

Entry point for function that generates several wiki links.
Parameters
NameTypepurpose
frametableContains frame from invoked module.
Return typeReturn purpose
stringA formated string containing one or more wikilinks.

p.createLinkBatch

This creates and formats many links.
Parameters
NameTypepurpose
linkstablea table containing links, e.g. {'Lua label1 type', 'www.google.com google ext'}.
separatorstringa separator between each link.
delimiterstringan optional delimiter that will separate the label, link & type.
Return typeReturn purpose
stringA formated string containing one or more wikilinks.
Advertisement