Template:Block indent/doc: Difference between revisions

From IDU Wiki
Jump to navigation Jump to search
en>RogueScholar
 
m 1 revision imported
 
(No difference)

Latest revision as of 12:40, 19 October 2026

Template:Template redirect

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]

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for Block indent

Add a content block indented from one or both page margins
ParameterDescriptionTypeStatus
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.
Contentrequired
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
Numberoptional
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
Numberoptional
Custom stylingstyle
Custom CSS style declarations to be added following the default (overflow: hidden;), each terminated by a semicolon
Example
font-size: 0.95rem;
Lineoptional
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
Lineoptional

Format: inline

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.

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 source]

Template:Block bug documentation

See also[edit source]

Template:Block indentations templates

Template:Semantic markup templates