Template:Infobox song/doc
This is a documentation subpage for
Template documentation[edit]
Template sandbox and testcases for TEMPLATE_NAME[edit]Overview[edit]This page provides a clean workflow to safely edit and validate TEMPLATE_NAME:
Use this page to:
Quick links[edit]
How to test[edit]1. Edit the sandbox at Template:TEMPLATE_NAME/sandbox. 2. Open this test page and click “Show preview” to render the sandbox with inputs below. 3. Verify each testcase: Does the “Actual output” match the “Expected output”? 4. If all pass, consider copying sandbox to live using an edit summary like: “Sync from /sandbox: passes all /testcases as of YYYY-MM-DD.” Previewing tips[edit]
Test harness[edit]The following sections render the sandbox template against curated inputs. Each testcase shows:
Testcase A: Minimal invocation[edit]Parameters: {{TEMPLATE_NAME}} Expected output: [Minimal successful output with defaults: e.g., a neutral message or basic box] Actual output (sandbox): Character and language test sandbox This sandbox is used to test how Template:TEMPLATE NAME behaves with special characters (such as Greek letters) and language-specific spans. Basic examples[edit]
Within the template[edit]Below are example calls of the template using these characters as parameters. {{TEMPLATE NAME | title = Greek test: α γ | summary = Demonstrating Greek letters: α, β, γ, and entities like γ. | attr1 = Direct Greek: α β γ δ | attr2 = Entity Greek: α β γ δ | attr3 = German label: <span lang="de">A</span>, English label: A }} Preview the page to check if:
Notes[edit]
Testcase B: Common parameters[edit]Parameters: {{TEMPLATE_NAME | param1 = Alpha | param2 = Beta | flag = yes }} Expected output: [Example: shows "Alpha" and "Beta" in designated slots; flag toggles enhanced styling] Actual output (sandbox): Character and language test sandbox This sandbox is used to test how Template:TEMPLATE NAME behaves with special characters (such as Greek letters) and language-specific spans. Basic examples[edit]
Within the template[edit]Below are example calls of the template using these characters as parameters. {{TEMPLATE NAME | title = Greek test: α γ | summary = Demonstrating Greek letters: α, β, γ, and entities like γ. | attr1 = Direct Greek: α β γ δ | attr2 = Entity Greek: α β γ δ | attr3 = German label: <span lang="de">A</span>, English label: A }} Preview the page to check if:
Notes[edit]
Testcase C: Edge values and escaping[edit]Parameters: {{TEMPLATE_NAME | param1 = [[Linked target|Visible text]] | param2 = {{subst:CURRENTTIMESTAMP}} | raw = <code><span class="x">escaped</span></code> }} Expected output: [Links render correctly; timestamp subst is literal in expected; raw shows escaped markup] Actual output (sandbox): Character and language test sandbox This sandbox is used to test how Template:TEMPLATE NAME behaves with special characters (such as Greek letters) and language-specific spans. Basic examples[edit]
Within the template[edit]Below are example calls of the template using these characters as parameters. {{TEMPLATE NAME | title = Greek test: α γ | summary = Demonstrating Greek letters: α, β, γ, and entities like γ. | attr1 = Direct Greek: α β γ δ | attr2 = Entity Greek: α β γ δ | attr3 = German label: <span lang="de">A</span>, English label: A }} Preview the page to check if:
Notes[edit]
Testcase D: Internationalization (i18n)[edit]Parameters: {{TEMPLATE_NAME | lang = ja | text = こんにちは世界 }} Expected output: [Text displays correctly for non-ASCII; applies lang attribute or rtl/ltr where applicable] Actual output (sandbox): Character and language test sandbox This sandbox is used to test how Template:TEMPLATE NAME behaves with special characters (such as Greek letters) and language-specific spans. Basic examples[edit]
Within the template[edit]Below are example calls of the template using these characters as parameters. {{TEMPLATE NAME | title = Greek test: α γ | summary = Demonstrating Greek letters: α, β, γ, and entities like γ. | attr1 = Direct Greek: α β γ δ | attr2 = Entity Greek: α β γ δ | attr3 = German label: <span lang="de">A</span>, English label: A }} Preview the page to check if:
Notes[edit]
Testcase E: Error handling[edit]Parameters: {{TEMPLATE_NAME | param1 = | required = <!-- intentionally omitted --> }} Expected output: [Shows a gentle error or maintenance category; does not break page layout] Actual output (sandbox): Character and language test sandbox This sandbox is used to test how Template:TEMPLATE NAME behaves with special characters (such as Greek letters) and language-specific spans. Basic examples[edit]
Within the template[edit]Below are example calls of the template using these characters as parameters. {{TEMPLATE NAME | title = Greek test: α γ | summary = Demonstrating Greek letters: α, β, γ, and entities like γ. | attr1 = Direct Greek: α β γ δ | attr2 = Entity Greek: α β γ δ | attr3 = German label: <span lang="de">A</span>, English label: A }} Preview the page to check if:
Notes[edit]
Maintenance[edit]
Categories[edit]Copy-paste skeletons[edit]Below are ready-to-use skeletons for the sandbox and testcases subpages. Skeleton: Template:TEMPLATE_NAME/sandbox[edit]<!-- Sandbox for TEMPLATE_NAME --> <!-- Copy the entire template source here; edit safely. --> {{#if:{{{required|}}} | <!-- normal output --> <div class="tmpl"> <b>{{{param1|}}}</b> · <i>{{{param2|}}}</i> {{#if:{{{flag|}}}|<span class="flag">✓</span>|}} {{#if:{{{raw|}}}|<span class="raw">{{{raw}}}</span>|}} </div> | <!-- error / missing required --> <span class="error">TEMPLATE_NAME: missing required parameter</span> [[Category:Pages with TEMPLATE_NAME errors]] }} Skeleton: Template:TEMPLATE_NAME/testcases[edit]<!-- Testcases for TEMPLATE_NAME; render against /sandbox --> ; Minimal : {{TEMPLATE_NAME/sandbox}} ; Common params : {{TEMPLATE_NAME/sandbox | param1 = Alpha | param2 = Beta | flag = yes }} ; Edge and escaping : {{TEMPLATE_NAME/sandbox | param1 = [[Linked target|Visible text]] | param2 = 20250101T000000Z | raw = <code><span class="x">escaped</span></code> }} ; I18n : {{TEMPLATE_NAME/sandbox | lang = ja | text = こんにちは世界 }} ; Error handling : {{TEMPLATE_NAME/sandbox | required = }} Review checklist[edit]
Template:Terminate sentence ensures a sentence ends with a specified terminator (default: a period). It avoids adding duplicate terminators and can optionally trim trailing spaces. It attempts to ignore trailing closing quotes or brackets when deciding whether a terminator is already present. Usage[edit]Basic: {{Terminate sentence|This is a sentence}}
→ This is a sentence.
Named parameters: {{Terminate sentence
|text=He said "Hello"
|term=.
}}
→ He said "Hello".
Custom terminator: {{Terminate sentence|text=Warning|term=!}}
→ Warning!
Avoid duplicate terminator: {{Terminate sentence|text=Already done.|term=.}}
→ Already done.
Trim trailing spaces: {{Terminate sentence|text=Ends with space |trim=yes}}
→ Ends with space.
Skip processing: {{Terminate sentence|text=No changes here|skip=yes}}
→ No changes here
Append a note: {{Terminate sentence|text=Complete|note=(source: 2025)}}
→ Complete. (source: 2025)
Parameters[edit]
Behavior details[edit]
Examples[edit]
{{Terminate sentence|text=He whispered "hush"|term=.}}
→ He whispered "hush".
{{Terminate sentence|text=Complete (verified)|term=.}}
→ Complete (verified).
{{Terminate sentence|text=Alert|term=!}}
→ Alert!
{{Terminate sentence|text=Wait...|term=.|allowdup=yes}}
→ Wait.... Best practices[edit]
Lua-powered variant (optional)[edit]For more robust detection (including multilingual quotes and punctuation), create -- Module:TerminateUtil
local M = {}
local closing = {
[")"] = true, ["]"] = true, ["}"] = true,
['"'] = true, ["'"] = true, ["”"] = true, ["’"] = true, ["»"] = true, ["›"] = true
}
local function trimRight(s)
return (s:gsub("%s+$",""))
end
function M.lastVisibleChar(args)
local s = args.s or ""
s = trimRight(s)
local i = #s
while i > 0 do
local c = s:sub(i,i)
if closing[c] then
i = i - 1
else
return c
end
end
return ""
end
return M
Then update the template to call: {{#invoke:TerminateUtil|lastVisibleChar|s=text}}
This improves detection for closing quotes and brackets. See also[edit]It may contain usage information, categories and other content that is not part of the original template page. |
The design and content of all music-related infoboxes should follow Wikipedia's verifiability policy, infobox style guideline and music style guideline. While this document may clarify details of their specific application to the infobox, it is primarily concerned with explaining usage and not with matters of Wikipedia policy and style. |
Usage
[edit]This is the template for the infobox for a song article—if the song has been released as one of the A-side and B-side of a single, then Template:Infobox single should be used instead.
Unless otherwise stated here, refer to Template:Infobox single for guidelines on how to use parameters that it shares with Template:Infobox song.
Code
[edit]| "Perfect Blue Buildings" | |
|---|---|
| Song by Counting Crows from the album August and Everything After | |
| Released | September 14, 1993 |
| Recorded | March 1993, Los Angeles |
| Genre | Alternative rock |
| Length | 5:00 |
| Label | Geffen |
| Writer | Adam Duritz |
| Producer | T-Bone Burnett |
| August and Everything After track listing | |
| |
{{Infobox song <!-- See Wikipedia:WikiProject_Songs -->
| Name =
| Type =
| Artist =
| alt Artist =
| Album =
| A-side =
| Recorded =
| Released = <!-- {{Start date|YYYY|MM|DD}} -->
| Published =
| Genre =
| Language =
| Length = <!-- {{Duration|m=MM|s=SS}} -->
| Writer =
| Composer =
| Label =
| Producer =
| ISWC =
| Tracks =
| prev =
| prev_no =
| track_no =
| next =
| next_no =
| Misc =
}}
Parameters
[edit]- Name
- This field should contain the name of the song. This field is required.
- Type
- If you want to add something more descriptive than "Song" use the "Type" field.
- Tracks
- There are two ways to create a track listing: a full listing or a partial listing. A full listing is preferred. Do not use both the full listing parameter and the partial listing parameters. (See the examples.)
- A full track listing is created using the
Tracksfield. List the tracks on the album in sequence using numbered list notation. Use links for the songs on the album that have Wikipedia articles. The name of the current song should be bold. - A partial listing is created using the
prev,prev_no,track_no,next, andnext_nofields. Song names should be quoted. Use links for songs that have a Wikipedia article.
- A full track listing is created using the
- Recorded
- This field should include details on when and where the song was recorded. Separate multiple values using {{Plainlist}}
- Released
- This field should contain the date the song was released, using {{Start date}}. This is typically the release date of the album on which the song was released. If the song was released as the B-side of a single, specify the release date of the single.
- Length
- Use {{Duration}}, thus:
{{Duration|m=3|s=45}}, renders as 3:45, for 3 minutes 45 seconds - ISWC
- International Standard Musical Work Code
Examples
[edit]The "Perfect Blue Buildings" Infobox on this page was created using the following template. It includes a full track listing.
{{Infobox song
| Name = Perfect Blue Buildings
| Artist = [[Counting Crows]]
| Album = [[August and Everything After]]
| Released = {{Start date|1993|09|14}}
| Recorded = March 1993, [[Los Angeles]]
| Genre = [[Alternative rock]]
| Length = {{Duration|m=5|s=00}}
| Writer = [[Adam Duritz]]
| Label = [[Geffen Records|Geffen]]
| Producer = [[T-Bone Burnett]]
| Tracks =
# "[[Round Here]]"
# "Omaha"
# "[[Mr. Jones (Counting Crows song)|Mr. Jones]]"
# "'''Perfect Blue Buildings'''"
# "Anna Begins"
# "Time and Time Again"
# "[[Rain King (Counting Crows song)|Rain King]]"
# "Sullivan Street"
# "Ghost Train"
# "Raining in Baltimore"
# "[[A Murder of One]]"
}}
To create a partial track listing, omit the Tracks parameter and replace it with the prev, prev_no, track_no, next, and next_no parameters.
{{Infobox song
| Name = Perfect Blue Buildings
| Artist = [[Counting Crows]]
| Album = [[August and Everything After]]
| Recorded = March 1993, [[Los Angeles]]
| Released = {{Start date|1993|09|14}}
| Genre = [[Alternative rock]]
| Length = {{Duration|m=5|s=00}}
| Writer = [[Adam Duritz]]
| Label = [[Geffen Records|Geffen]]
| Producer = [[T-Bone Burnett]]
| prev = "[[Mr. Jones (Counting Crows song)|Mr. Jones]]"
| prev_no = 3
| track_no = 4
| next = "Anna Begins"
| next_no = 5
}}