en>Qwerty284651
No edit summary
 
m (1 revision imported)
 
(No difference)

Latest revision as of 18:34, 6 July 2024

Template:Documentation subpage Template:High-use Template:Tsh Template:Uses TemplateStyles

Usage

Template:Tl adds a block of indented text to a page.

{{block indent|1=Template:Var}}

Alternatives that are not recommended

A colon at the start of the line produces a similar indent, but it produces incorrect HTML. See MOS:INDENT. (An initial : was intended only for use after ;, in constructing description lists, but most editors have used it almost everywhere for indenting.)

Template:Tl is for actual quotations only. Using it for block indent is not correct semantic HTML, and the appearance differs. (Template:Tl produces the HTML Template:Tag element, which indicates a block quotation; Template:Tl produces the HTML Template:Tag element.)

The default display of Template:Tl differs from that of Template:Tl in that it does not:

  • introduce whitespace margins above or below the indented material (just add a blank line above and/or below manually); nor
  • indent from the right as well as the left (there is an optional parameter for this); nor
  • affect the font size of its contents; nor
  • (on mobile) bookend the block with large quotation marks; nor
  • support plain blank-line paragraph breaks inside it; nor
  • support attribution parameters (because Template:Tl isn't for quotations).

Template:Tl and Template:Tl both support paragraph breaks using Template:Tag around second and subsequent paragraphs, as well as other HTML markup, and it is always safest to explicitly format with HTML rather than rely on MediaWiki's parser to do the right thing, because the developers could alter its behavior at any time.

Example

Template:Tlx

produces:

Template:Block indent

Parameters

Template:Para a.k.a. Template:Para The material to be indented. Template:Strong, because any occurrence (e.g. in a URL, template, etc.) of the = character will break the template without it.

Template:Para a.k.a. Template:Para the value (e.g. 0.1 or 7) in em units by which to indent the material from the left; defaults to 3

Template:Para the value, also in em, by which to indent the material from the right; defaults to 0 (use 7 to match the default left indentation)

Template:Para arbitrary CSS declarations, e.g. font-size: 95%;. This parameter should not normally be needed. Note: It already includes overflow: hidden; by default, to avoid collision of the div's background with floating elements.

Template:Para any CSS class names (e.g. as defined at MediaWiki:Common.css), comma-separated if more than one. This parameter should not normally be needed.

Comparison with Template:Tl (block quotation)

{{Block indent/doc}} Template:Tl
{{Lorem ipsum}}{{block indent|1={{Lorem ipsum}}{{Lorem ipsum}}}}{{Lorem ipsum}} {{Lorem ipsum}}{{Blockquote|1={{Lorem ipsum}}{{Lorem ipsum}}}}{{Lorem ipsum}}
Template:Lorem ipsumTemplate:Block indentTemplate:Lorem ipsum Template:Lorem ipsumTemplate:BlockquoteTemplate:Lorem ipsum

Technical issues with block templates

Template:Block bug documentation

See also

  • Template:Tl, which indents a single line, after a newline, using a mixture of en- and em-sized spaces
  • Template:Tl, which indents a single line (or content inline in one) uses non-breaking spaces
  • Template:Tl, which indents a single line (or content inline in one), skipping up to fifty equal en-sized spaces
  • Template:Tl, the block hanging indent template
  • Template:Tl, the block quotation template, which is only for quotations

Template:Semantic markup templates