Template:Reply: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(this div seems to be out of place - trying to fix indentation problem after template is used)
mNo edit summary
Line 1: Line 1:
<table width=100% cellpadding="0" cellspacing="0"><tr><td width={{switch|{{{level|0}}}|case: 0=0%|case: 1=3%|case: 2=6%|case: 3=9%|case: 4=12%|case: 5=15%|case: 6=18%|case: 7=21%|case 8=24%}}></td><td><table style="margin-top: 0px; margin-bottom: 0px"><tr style="background-color:#e8e8e8; border:1px solid #c0c0c0"><td style="padding: 0 0 0 1.5em">
<table width=100% cellpadding="0" cellspacing="0"><tr><td width={{switch|{{{level|0}}}|case: 0=0%|case: 1=3%|case: 2=6%|case: 3=9%|case: 4=12%|case: 5=15%|case: 6=18%|case: 7=21%|case 8=24%}}></td><td><table style="margin-top: 0px; margin-bottom: 0px"><tr style="background-color:#e8e8e8; border:1px solid #c0c0c0"><td style="padding: 0 0 0 1.5em">
<small>Reply by:</small> {{{1|{{{by|unsigned (see History)}}}}}}
<small>Reply by:</small> {{{1|{{{by|unsigned (see History)}}}}}}
</td><td width=2%>[[Template:Reply|<small>&nbsp;''Help&nbsp;</small>]]</td></tr><tr><td colspan=2 style="background-color:{{switch|{{{color|none}}}|case: none=#d8d8d8;|case: g=#d8eed8;|case: r=#eed8d8;|case: y=#eeeeb8;|case: b=#d0d0e8;|case: m=#e8d4ee;|case: w=#f8f8f8;}} border:1px solid #a0a0a0; padding: 0 .5em .3em 1.5em">
</td><td width=2%>[[Template:Reply|<small>&nbsp;''Help''&nbsp;</small>]]</td></tr><tr><td colspan=2 style="background-color:{{switch|{{{color|none}}}|case: none=#d8d8d8;|case: g=#d8eed8;|case: r=#eed8d8;|case: y=#eeeeb8;|case: b=#d0d0e8;|case: m=#e8d4ee;|case: w=#f8f8f8;}} border:1px solid #a0a0a0; padding: 0 .5em .3em 1.5em">
{{{text|To create this field, use: <tt> <nowiki>text=<text of reply></nowiki></tt>}}}
{{{text|To create this field, use: <tt> <nowiki>text=<text of reply></nowiki></tt>}}}
</td></tr></table></td></tr></table><noinclude>
</td></tr></table></td></tr></table><noinclude>
Line 224: Line 224:
; Indenting curly braces in code
; Indenting curly braces in code


It helps for the readibility and visualization of the intended output if one indents the curly braces ( <nowiki>{{</nowiki> & <nowiki>}}</nowiki> ) for each reply - 2 spaces per nesting level.  This is shown in the above code.  Also note the use of a blank line as a paragraph separator, with a Reply to a paragraph coming '''before''' any trailing blank line paragraph separator.  This, too, improves visualization in the code.
It helps for the readability and visualization of the intended output if one indents the curly braces ( <nowiki>{{</nowiki> & <nowiki>}}</nowiki> ) for each reply - 2 spaces per nesting level.  This is shown in the above code.  Also note the use of a blank line as a paragraph separator, with a Reply to a paragraph coming '''before''' any trailing blank line paragraph separator.  This, too, improves visualization in the code.
</div></noinclude>
</div></noinclude>

Revision as of 05:08, 9 April 2015

Reply by: unsigned (see History)

 Help 

To create this field, use: text=<text of reply>



Syntax and usage

This template may be used to post replies to threads on Talk pages that have been started with Template:ItemPost.

Syntax with two required parameters

{{reply|by=<User ID & Date>|text=<text of message>}}

Optional level and color parameters

{{reply|level=<n>|color=<color>|by=<User ID & Date>|text=<text of message>}}

One of both of the level and color parameters may be omitted. In all cases, the order of the parameters is unimportant. Examples of usage are given below.


Allowable values for level are 0,1,...,8, with 0 being the default if level is omitted. The value n for level produces 20n pixels of indentation.

Allowable values for color are:

r (for red)
g (for green)
b (for blue)
y (for yellow)
m (for magenta)

If omitted, the background text color defaults to grey.

Note: As always, the simplest way to specify your <User ID & Date> is by typing four tildes (~~~~, which generates your signature and current timestamp, as follows:

{{reply|by=~~~~|text=This reply is short!}}

And this generates the display:

Reply by: Chucktalk Giffen 05:54, 29 July 2008 (PDT)

 Help 

This reply is short!

The Reply template may be placed inside the text field of an ItemPost or other Reply template, especially useful for nonlinear threads of discussion.

Here is a lengthy example, illustrating both kinds of placement (the code which produced this is given below):

  • Posted by: UserA, Sometime
 Help 

Here is an item posted by UserA.

Reply by: UserC, EvenLaterThanB

 Help 

UserC has inserted a reply to UserA's first paragraph.

Here is a second paragraph by UserA.

Reply by: UserB, SomewhatLater

 Help 

UserB has inserted a reply to UserA's second paragraph.

Reply by: UserD, StillLater

 Help 

UserD has also inserted a reply to UserA's second paragraph.

And here is another paragraph to UserD's reply.

And a third.

Reply by: UserE, MuchLater

 Help 

UserE has replied to the third paragraph of UserD's reply.

And a fourth (long-winded, right?).

And a third by UserA.

Reply by: UserF, VeryMuchLater

 Help 

UserF has inserted a reply to UserA's last paragraph.

Reply by: UserP, SometimeEvenLater

 Help 

This is a reply to the whole of UserA's posting. It is placed outside the above posting, indented one level.

Reply by: UserR, Sometime

 Help 

Here, UserR is replying to UserP's reply, and it is indented two levels.

Reply by: UserQ, SometimeLater

 Help 

UserQ is also replying to the whole of UserA's post.

Reply by: UserS, VeryMuchLater

 Help 

UserS, also into colored backgrounds, has replied to the first paragraph of UserQ's reply.

Note that there is no level indication for UserS's reply, since it is placed inside the reply by UserQ.

Furthermore, UserS has not bothered to indent the curly braces to visualize formatting in the code.

And UserQ has selected a yellow text background, perversely or not!?!

Reply by: UserT, SometimeAfterQ

 Help 

UserT replies to UserQ's reply, indicating that s/he would never used colored backgrounds!! And indenting the curly braces in the code has once again been omitted.

Reply by: UserQ, SometimeAfterT

 Help 

UserQ replies back to UserT that it is impossible to live without a yellow background!

Reply by: UserU, LastOfAll

 Help 

UserU replies to UserT that yellow isn't nearly as good as blue.

The code which produced the above example is the following (see note below about indenting opening and closing curly braces ( {{ & }} ) to help in visualizing nesting or indentation level):

{{ItemPost|by=UserA, Sometime|text=
Here is an item posted by UserA.
  {{reply|by=UserC, EvenLaterThanB|text=
UserC has inserted a reply to UserA's
first paragraph.
  }}

Here is a second paragraph by UserA.
  {{reply|by=UserB, SomewhatLater|text=
UserB has inserted a reply to UserA's
second paragraph.
  }}

  {{reply|by=UserD, StillLater|text=
UserD has also inserted a reply to UserA's
second paragraph.

And here is another paragraph to UserD's
reply.

And a third.
    {{reply|by=UserE, MuchLater|text=
UserE has replied to the third paragraph
of UserD's reply.
    }}

And a fourth (long-winded, right?).
  }}

And a third by UserA.
  {{reply|by=UserF, VeryMuchLater|text=
UserF has inserted a reply to UserA's last
paragraph.
  }}
}}

  {{reply|level=1|by=UserP, SometimeEvenLater|text=
This is a reply to the whole of UserA's posting.
It is placed '''outside''' the above posting,
indented one level.
  }}

    {{reply|level=2|by=UserR, Sometime|text=
Here, UserR is replying to UserP's reply,
and it is indented two levels.
    }}

{{reply|level=1|color=y|by=UserQ, SometimeLater
|text=
UserQ is also replying to the whole of UserA's post.
{{reply|color=r|by=UserS, VeryMuchLater|text=
UserS, also into colored backgrounds, has replied
to the first paragraph of UserQ's reply.

Note that there is no level indication for UserS's
reply, since it is placed '''inside''' the reply by
UserQ.

Furthermore, UserS has not bothered to indent the
curly braces to visualize formatting in the code.
}}

And UserQ has selected a yellow text background,
perversely or not!?!
}}

{{reply|level=2|by=UserT, SometimeAfterQ|text=
UserT replies to UserQ's reply, indicating that s/he
would '''never''' used colored backgrounds!!
And indenting the curly braces in the code has
once again been omitted.
}}

      {{reply|level=3|color=y|by=UserQ, SometimeAfterT|text=
UserQ replies back to UserT that it is impossible to
live without a yellow background!
      }}

        {{reply|color=b|level=4|by=UserU, LastOfAll|text=
UserU replies to UserT that yellow isn't nearly
as good as blue.
        }}
Indenting curly braces in code

It helps for the readability and visualization of the intended output if one indents the curly braces ( {{ & }} ) for each reply - 2 spaces per nesting level. This is shown in the above code. Also note the use of a blank line as a paragraph separator, with a Reply to a paragraph coming before any trailing blank line paragraph separator. This, too, improves visualization in the code.