Template:Dialogue/doc

This is a complex template designed to make it easy to write out lines of dialogue. This template cannot be subst:'d. The template can handle most standard formats of writing dialogue, and can be indented, bulleted or numbered.

{{Dialogue}} facilitates the writing of dialogue in a standard format.

Syntax

[edit source]

This is how to write the template in wikitext onto your article:

{{dialogue
|short=full
|short=full
|short=full
...
|Character|Speech
|Character|Speech
|Character|Speech
...
}}

These parameters are explained more fully below.

Parameters

[edit source]

Named parameters specify name shortcuts. They are all optional. They are placed at the top of the template call, like this:

{{dialogue
|short=full
|short=full
|short=full
...

Name shortcuts apply to your main dialogue text. If you use a shortcut specified here for a character name, then the full name will be replaced for it.

Named parameters of the form "mood1", "mood2", "mood3", etc., up to "mood10", specify moods for the corresponding line number (e.g. "mood1" specifies line 1). They are placed in a line like this:

...
|Character|Speech|mood1=angry
|Character|Speech|mood2=quiet
|Character|Speech|mood3=ecstatic
...

Positional parameters form the text of the dialogue (i.e. any line not containing an "=" will be construed as part of the dialogue.

Parameter 1 (required)
Character name speaking
Parameter 2 (optional)
Line to speak
Parameter 3 (optional)
Next character
Parameter 4 (optional)
Next line
Parameter 5 (optional)
Next character
Parameter 6 (optional)
Next line
Parameter 7 (optional)
so on...

This extends for 10 lines at maximum. After that, unfortunately the template will have to be manually called again from the code.

Note: if any character is called "action" then that line will be construed as an action line. It still counts as a line nonetheless.

Examples

[edit source]

Here is an example of a full template usage:

{{dialogue
|officer=Officer
|chicolini=Chicolini
|firefly=[[Rufus T. Firefly|Firefly]]
|officer|Chicolini, you're charged with high treason, and if found guilty, you will be shot.
|chicolini|I object.
|officer|Oh, you object? On what grounds?|mood3=derisively
|chicolini|I couldn't think of anything else to say.
|firefly|Objection sustained.|mood5=interrupting
|officer|Your Excellency, you sustained the objection?!|mood6=surprised
|firefly|Sure, I couldn't think of anything else to say, either. Why don't you object?
}}

The above would generate:

Officer: Chicolini, you're charged with high treason, and if found guilty, you will be shot.
Chicolini: I object.
Officer (derisively): Oh, you object? On what grounds?
Chicolini: I couldn't think of anything else to say.
Firefly (interrupting): Objection sustained.
Officer (surprised): Your Excellency, you sustained the objection?!
Firefly: Sure, I couldn't think of anything else to say, either. Why don't you object?

The below code demonstrates examples of extended use:

{{dialogue
|george=George
|rachel=Rachel

|action|Enter: George and Rachel
|george|Good morrow dearest Rachel! And what a beautiful morning it is! The sun is shining, the birds are singing in the trees, why it is enough to make one feel as if...|mood2=happy
|action|Rachel turns to see him
|rachel|Oh, George, it's you!
|george|
|rachel|Is something wrong, George?|mood6=worried
|action|Enter: Guards
|Guards|We are announcing George's arrest!
|rachel|Oh my!|mood9=horrified
|action|George is dragged away.
}}

The above would generate:

[Enter: George and Rachel]
George (happy): Good morrow dearest Rachel! And what a beautiful morning it is! The sun is shining, the birds are singing in the trees, why it is enough to make one feel as if...
[Rachel turns to see him]
Rachel: Oh, George, it's you!
George: ...
Rachel (worried): Is something wrong, George?
[Enter: Guards]
Guards: We are announcing George's arrest!
Rachel (horrified): Oh my!
[George is dragged away.]

This is a local fork of the Wikipedia template. Upstream, {{Dialogue}} emits nothing but bold names, <q> and <br />, so a call sitting in a paragraph rendered as ordinary prose — indistinguishable from the text around it. Here it renders as its own <blockquote class="dialogue">, styled by Template:Dialogue/styles.css, so it sits on the page the way {{Quote}} does: indented, behind the skin's quote rule, and with each line hanging-indented so speech that wraps tucks under the speaker's name rather than running back to the margin. action lines are set as italic stage directions, with no hanging indent.

Because the template is a block, put the call on its own line. Don't nest it in a numbered or bulleted list, and don't wrap it in a <blockquote> — both of which upstream's inline version allowed, and neither of which nests sensibly now.

If you need 11 or more lines, split the call in two. Otherwise you'll see this:

Line 10: ...
Sorry, this template can only support a maximum of 10 lines of dialogue. If you wish to write more, the code must be split into multiple template calls.