Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a231de983d6aaedd

Jump to content

Template:Block indent/doc

From Wikipedia, the free encyclopedia

The {{Block indent}} template adds an indented content block to a page.

Usage

[edit]

{{Block indent|1=The material to be indented here. May include markup, paragraph breaks, etc.}}

Example

[edit]

{{Block indent|1=Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

TemplateData

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Block indent in articles based on its TemplateData.

TemplateData for Block indent

Add a content block indented from one or both page margins
Indented content1
content
quote
text
The page content to display indented. This should always be defined as a named, not an unnamed, parameter to avoid parser errors.
Left indentation widthleft
em
A valid CSS length value (e.g. 0.1 or 7) in em units by which to indent the material from the left page margin
Default
3
Right indentation widthright
A valid CSS length value, also in em units, by which to indent the material from the right page margin (define as 7 to match the default left margin indentation)
Default
0
Custom stylingstyle
Custom CSS style declarations to be added following the default (overflow: hidden;), each terminated by a semicolon
Example
font-size: 0.95rem;
CSS classesclass
Additional CSS class names (e.g. as defined at MediaWiki:Common.css) to declare alongside the default (block-indent), whitespace-delimited if more than one
Example
toccolours2
[edit]

A colon at the start of the line produces a similar indent, but it produces incorrect HTML; see Wikipedia:Manual of Style § Indentation for more details. (An initial : was intended only for use after ; in constructing description lists, but many editors have used it ubiquitously for simple indentation.)

{{Blockquote}} employs the HTML <blockquote>...</blockquote> element and is intended for use only with actual block quotation; using it for indenting simple block elements breaks semantic HTML and the appearance differs. (Whereas {{Block indent}} employs an HTML <div>...</div> element with padding offsetting it from the left and/or right page margins.)

The default display of {{Block indent}} differs from that of {{Blockquote}} in that it does not:

  • introduce vertical whitespace above or below the indented material (add blank lines above and/or below manually, as needed)
  • indent from the right as well as the left (though the optional |right= parameter triggers this behavior)
  • affect the font size of its contents
  • bookend the block with large quotation marks on mobile devices
  • support plain blank-line paragraph breaks inside it, or
  • support attribution parameters (because {{Block indent}} isn't for quotations).

{{Blockquote}} and {{Block indent}} both support internal paragraph breaks through the use of HTML <p>...</p> tags around subsequent paragraphs, as well as other HTML markup. It is always safest to explicitly format using raw HTML rather than rely on MediaWiki's parser because future updates to it could alter the output at any time.

Comparison with Template:Blockquote

[edit]
{{Block indent}}[a] {{Blockquote}}[b]

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Source wikitext:
  1. {{Lorem ipsum}}{{Block indent|1={{Lorem ipsum}}}{{Lorem ipsum}}
  2. {{Lorem ipsum}}{{Blockquote|1={{Lorem ipsum}}}}{{Lorem ipsum}}

Technical issues with block templates

[edit]

If the block-formatted content uses a named parameter (including |1=) and begins with a list (or any other wikimarkup that is dependent upon a specific markup character being at the beginning of a line), because MediaWiki behavior is to strip whitespace from named parameters, a <nowiki /> and a new line must exist before the list (or whatever) starts. This no longer affects unnamed parameters. Compare:

  code result
Works as intended {{Block indent|
*Firstly, ...
*Secondly, ...
*Thirdly, ...
}}
  • Firstly, ...
  • Secondly, ...
  • Thirdly, ...
FAIL {{Block indent|1=
*Firstly, ...
*Secondly, ...
*Thirdly, ...
}}
*Firstly, ...
  • Secondly, ...
  • Thirdly, ...
Works as intended {{Block indent|1=<nowiki />
*Firstly, ...
*Secondly, ...
*Thirdly, ...
}}
  • Firstly, ...
  • Secondly, ...
  • Thirdly, ...

To embed a table in block markup like this, the block template's content parameter must be named or numbered and include the self-closing nowiki – as in |1=<nowiki /> – then every | character in the table markup must be escaped with {{!}}. An alternative is to use explicit HTML <table>, <tr>, <th>, and <td> markup.

See also

[edit]
Block indentation templates
Use case Template
Long quotations {{Blockquote}}
With line breaks {{Poem quote}}
Non-quotations {{Block indent}}
{{Indent 5}} (inline)
Math formulae See <math> blocks