Template:LinkLexicon: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
m Oops, missed one.
Add style parameter; implement style=raw; style=raw example
Line 1: Line 1:
<includeonly>*[http://www.conwaylife.com/ref/lexicon/{{{filename|{{{1}}}}}} {{{patternname|{{PAGENAME}}}}}] at the Life Lexicon [[Category:Pages that link to the Life Lexicon]]</includeonly><noinclude>This is a template for including links to the '''[http://www.conwaylife.com/ref/lexicon/lex_home.htm Life Lexicon]''' in the "External Links" section of an article. It can take two parameters: ''filename'', which specifies the HTML file (including anchor) that will be linked to on the Life Lexicon, and ''patternname'', which specifies the name of the pattern as it will appear in the link text. If patternname is omitted, the name of the current article will be used by default.
<includeonly>{{#ifeq: {{{style|listitem}}} | listitem |* [http://www.conwaylife.com/ref/lexicon/{{{filename|{{{1}}}}}} {{{patternname|{{PAGENAME}}}}}] at the Life Lexicon | {{#ifeq: {{{style|raw}}} | raw | [http://www.conwaylife.com/ref/lexicon/{{{filename|{{{1}}}}}} {{{patternname|{{{filename|{{{1}}}}}}] }} [[Category:Pages that link to the Life Lexicon]]</includeonly><noinclude>This is a template for including links to the '''[http://www.conwaylife.com/ref/lexicon/lex_home.htm Life Lexicon]''' in the "External Links" section of an article. It can take three parameters:
 
* ''filename'', which specifies the HTML file (including anchor) that will be linked to on the Life Lexicon;
* ''patternname'', which specifies the name of the pattern as it will appear in the link text (default: name of the current article for style=listitem, or filename for style=raw);
* ''style'', which specifies how to format the link (style=listitem or style=raw; default: listitem)


Here is a simple example of its usage:
Here is a simple example of its usage:
Line 10: Line 14:


* [http://www.conwaylife.com/ref/lexicon/lex_1.htm#a1234 1-2-3-4] at the Life Lexicon
* [http://www.conwaylife.com/ref/lexicon/lex_1.htm#a1234 1-2-3-4] at the Life Lexicon
'''You type:'''
<tt><nowiki>{{LinkLexicon|filename=lex_1.htm#a1234|patternname=1-2-3-4|style=raw}}</nowiki></tt>
'''You see:'''
[http://www.conwaylife.com/ref/lexicon/lex_1.htm#a1234 1-2-3-4]


==See also==
==See also==

Revision as of 13:38, 11 January 2017

This is a template for including links to the Life Lexicon in the "External Links" section of an article. It can take three parameters:

  • filename, which specifies the HTML file (including anchor) that will be linked to on the Life Lexicon;
  • patternname, which specifies the name of the pattern as it will appear in the link text (default: name of the current article for style=listitem, or filename for style=raw);
  • style, which specifies how to format the link (style=listitem or style=raw; default: listitem)

Here is a simple example of its usage:

You type:

{{LinkLexicon|filename=lex_1.htm#a1234|patternname=1-2-3-4}}

You see:

You type:

{{LinkLexicon|filename=lex_1.htm#a1234|patternname=1-2-3-4|style=raw}}

You see:

1-2-3-4

See also