Template:Sp/doc

From Angelina Jordan Wiki
This is a subpage documenting Template:Sp. To change the template, edit that page; to change the template's documentation (seen below), edit this one.

Documentation

The name of this template is based on the word "space".

This template is used on a great many pages. Making any changes to it will cause lots of jobs to be added to the processing queue.

Usage

  • {{sp}}
  • {{sp|ignored text}}

Examples

  • AA{{sp}}AA ⇒ AA AA
  • AA{{sp|text}}AA ⇒ AA AA

Note: The "A" characters are used in these examples just to clarify the output of the template.

In template code

Here's a more realistic example. Suppose you want a template to output "This." when called without a defined first parameter, but "This something." when called with the first parameter set to something.

This code will not do what you want:

  • This{{#if:{{{1|}}}| {{{1}}}}}.

It will output "Thissomething.", with no space between the words, because the space after the pipe character (|) is being ignored (see Template:Test-if for more information).

To fix the problem, use {{sp}} in place of the space character:

  • This{{#if:{{{1|}}}|{{sp}}{{{1}}}}}.