Template:Block indent/sandbox
| File:Sandbox.svg | This is the template sandbox page for Template:Block indent (diff). See also the companion subpage for test cases. |
| Warning | This template is used in system messages, and on approximately 522,000 pages, or roughly 5894% of all pages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
| CSS | This template uses TemplateStyles: |
The {{Block indent}} template adds an indented content block to a page.
Usage[edit source]
{{Block indent|1=The material to be indented here. May include markup, paragraph breaks, etc.}}
Example[edit source]
{{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.}}
TemplateData[edit source]
TemplateData for Block indent
Add a content block indented from one or both page margins
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Indented content | 1 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. | Content | required |
| Left indentation width | left em | A valid [[CSS]] length value (e.g. <kbd>0.1</kbd> or <kbd>7</kbd>) in [[Em (typography)|em units]] by which to indent the material from the left page margin
| Number | optional |
| Right indentation width | right | A valid [[CSS]] length value, also in [[Em (typography)|em units]], by which to indent the material from the right page margin (define as <code>7</code> to match the default left margin indentation)
| Number | optional |
| Custom styling | style | Custom [[CSS]] style declarations to be added following the default (<code>overflow: hidden;</code>), each terminated by a [[semicolon]]
| Line | optional |
| CSS classes | class | Additional [[CSS]] class names (e.g. as defined at [[MediaWiki:Common.css]]) to declare alongside the default (<code>block-indent</code>), [[Whitespace character|whitespace]]-delimited if more than one
| Line | optional |
Alternatives that are not recommended[edit source]
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 Template:Parameter 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 source]
| {{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. |
Technical issues with block templates[edit source]
Template:Block bug documentation
See also[edit source]
Template:Block indentations templates
- {{Blockquote}}, only for use with block quotations
- {{Hanging indent}}
- {{Indent}} – indents a single line, after a newline, using a mixture of en and/or em spaces
- {{Indent 5}} – indents a single line (or portion of inline content) using up to fifty (50) equal en spaces
- {{Spaces}} – indents a single line (or portion of inline content) using non-breaking spaces