×
Create a new article
Write your page title here:
We currently have 230 articles on Farthest Frontier. Type your article name above or create one of the articles listed here!



    Farthest Frontier

    eesti  Deutsch  dansk  čeština  asturianu  català  Boarisch  English  español  sicilianu  中文(简体)  中文(繁體)  Esperanto  Tiếng Việt  Scots  українська  Zazaki  Türkçe  ไทย  slovenščina  polski  മലയാളം  galego  Ελληνικά  日本語  ქართული  македонски  فارسی  Nederlands  မြန်မာဘာသာ  русский  中文  suomi  العربية  norsk bokmål  norsk  Lëtzebuergesch  српски / srpski  Plattdüütsch  български  한국어  svenska  português do Brasil  hrvatski  ဘာသာ မန်  français  magyar  euskara  עברית  Mirandés  italiano  اردو  português  Bahasa Indonesia  বাংলা  Bahasa Melayu  беларуская (тарашкевіца)  edit The expansion demo templates (see [1]) show, for documentation:

    • some wikitext
    • its rendering
    • a link to ExpandTemplates applied to the wikitext; thus it shows:
      • The expanded wikitext.
      • The rendering of this expanded wikitext

    {{xpd}} selects one of the following four templates based on the number of unnamed parameters

    Examples

    • {{xpd|CURRENTDAY}}
    • {{xpd|#expr:2+2}} gives: Template:Xpd0

    For more examples see the separate templates.

    Separator parameter

    The default separator is "gives". With gives={{!}}{{!}} to get "||" for use in a table, the same separator is used before the ExpandTemplates link.

    Example:

    {| class="wikitable"
    ! wikitext !! result !! ExpandTemplates
    |-
    | {{xpd|CURRENTDAY|gives={{!}}{{!}}}}
    |-
    | {{xpd|#expr:2+2|gives={{!}}{{!}}}}
    |}
    

    gives

    wikitext result ExpandTemplates
    Template:Xpd0
    Template:Xpd0

    Quotes

    The quotation marks are needed to see spaces and newlines at the start and end of the result. In other expand demo templates they are also needed to see spaces and newlines at the start and end of the wikitext, and to get a result independent of whether it starts on a line due to parameter {{{gives}}}.

    Limitations

    This Template:Xpd is a simplified version of some expansion demo templates. If necessary use the proper extended version.

    Named parameters and parameter values with equals signs

    Named parameters are not supported. Neither are equals signs in parameter values of the template or parser function demonstrated.

    Examples:

    • {{xpd|1x| p{{=}}q }} gives Template:Xpd1 - wrong result due to the template call in the parameter; is corrected by substitution and putting nowiki tags in the lefthand side (see below), giving {{1x| p{{=}}q }} gives Template:1x [2].
    • {{xpd|1x|2= p=q }} gives Template:Xpd1 - wrong result because the lefthand side would be expanded interpreting p as named parameter, while the righthand side shows the result if the unnamed parameter of 1x has the given value.
    • {{xpd|2x|q=s}} gives: Template:Xpd0 ("q=s" is ignored).

    Even in the case of a parser function called with a parameter containing an equals sign the template for named parameters should be used:

    Rendering of left side

    If no value for parameter p is given, the left-hand side, before "gives", does not show the literal wikitext of the parameters of the template or parser function demonstrated, but the rendering. This affects e.g. sequences of more than two spaces, and single newlines. Also link code is shown as a link. Furthermore, any templates and parser functions in the parameters are expanded; m:Template:xpdn (backlinks edit) covers the simpler of such cases.

    Examples:


    {{xpd|1x|[[Help:Link]]}}
    
    {{xpd|tl|p
    q}}
    

    gives:


    Template:Xpd1

    Template:Xpd1


    With substitution of xpd1 etc. (see below) and putting nowiki tags around the list of parameters the left hand side is corrected.

    Also the input text of ExpandTemplates in the supplied link is the result of expanding the parameters.

    Spaces and newlines

    If parameters start or end with a space or newline, these are preserved. Even if the left-hand side, as mentioned, does not show the raw wikitext of the parameters but the rendering, the right-hand side gives the correct result.

    Substitution

    • {{subst:xpd|substnp=subst:|t1|p}} gives the wikitext {{xpd1|t1|p}}
    • {{subst:xpd|substnp=subst:|t2|p|q}} gives the wikitext {{xpd2|t2|p|q}}
    • {{subst:xpd|substnp=subst:|concat|p|q|r}} gives the wikitext {{xpd3|concat|p|q|r}}

    Note that except in the case of long and complicated parameters, adding the number of parameters after "xpd" is easier than adding "subst:" and "|substnp=subst:".

    With substitution of xpd1 etc. and putting nowiki tags around the list of parameters the left hand side is given literally without conversions, see also above.

    See also

    • {{Demo}} - a more robust and flexible template with the same functionality
    • {{xpsoc}} - simplified version
    • {{xpd0}} - simplified version of {{xpdoc}}
    • {{xpd1}} - simplified version of {{xpdopec}}
    • {{xpd2}}
    • {{xpd3}}
    • Xpd templates
    • {{tlx}} - produces just the template call, with the template name linked to the template, but not the result, e.g. Template:Xpd3
    • {{xpd}}
    • {{no}}

    Undocumented (so far):

    Other formatting templates

    {{#lsth:Template:Template-linking_templates|Other formatting templates}}


    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.