User:Lwarrenwiki/Cheatsheet
Ye olde Lwarrenwiki cheat sheet
{{nbsp|3}} ([https://en.wikipedia.org/w/index.php?title=User:Lwarrenwiki/Cheatsheet&action=edit Edit cheatsheet])
Anti-vandalism tools
= Request for page protection ([[:WP:RFPP]]), Hamiltrash sample =
Sample page protection request, for use at WP:RFPP. See User:Lwarrenwiki/sandbox#Hamiltrash template maker for more variations.
{{Block indent|{{small|
=== :Angelica Hamilton ===
- {{pagelinks|Angelica Hamilton}}
Indefinite semi-protected: Semi-protection requested due to moderate but highly persistent level of long-term WP:SPA and IP vandalism related to Hamilton (musical), conforming to long-standing #Hamiltrash pattern of vandalism. ~~~~
= Talk page vandalism warnings =
Automated warnings can be generated by Twinkle, when pulled down on the editor's User page or User Talk page. This proved easier and more versatile than my sidebar hack at :User:Lwarrenwiki/hamiltrash.js and my previous manual template (both detailed in the collapsed section below). Sample comments:
General{{nbsp|3}} |
|
Lams |
|
Lyrics |
|
{{collapse top |left=true |bg=Ivory |indent=1.6em |title=Variations on the user warning message }}
- Hamiltrash.js gets called from :User:Lwarrenwiki/vector.js {{small|(since May 2018)}} to rewrite the left sidebar during user talk page edits.
- See WP:WARN (Template messages/User talk namespace) for a full list and documentation of user warning templates.
- From my previous template, variations on the warning text:
{{Block indent|
{{monodiv|1=
Thank you. {{subst:4~}}
}} }}
{{collapse end}}
= Reporting a [[:WP:vandalism-only account|vandalism-only account]] =
= Reporting edit warring (3RR) =
= Resolved =
{{Tmbox|image={{Resolved mark}}|text=This is done.}}
::
{{Tmbox|image={{Resolved mark}}|text=This is done.}}
= Responding to edit requests =
{{Blue|
{{Edit semi-protected|demo {{=}}yes|answered {{=}}yes}} }}
:Template:Edit semi-protected produces a small box on the right, e.g., for deactivating a request for an edit to a semi-protected page.
:Template:ESp includes a long list of templates for adding a detailed response when deactivating a request for an edit to a semi-protected page.
{{collapse top |left=true |bg=Ivory |indent=1.6em |title=ESp templates for graphical icons}}
produces {{tlx|Done}} graphic before a further message:{{subst:ESp|d}}
:: File:Yes check.svg Done {{Blue|Further message.}}
produces {{tlx|Partly done}} graphic before a further message:{{subst:ESp|pd}}
:: File:Gold check mark.svg Partly done: {{Blue|Further message.}}
produces {{tlx|Not done}} graphic before a further message:{{subst:ESp|n}}
:: File:Red information icon with gradient background.svg Not done: {{Blue|Further message.}}
produces {{tlx|Note2}} graphic before a further message:{{subst:ESp|note}}
:: File:Pictogram voting comment.svg Note: {{Blue|Further message.}}
produces {{tlx|Not done}} and a clarity rejection, before a further message:{{subst:ESp|xy}}
:: File:Red question icon with gradient background.svg Not done: it's not clear what changes you want to be made. Please mention the specific changes in a "change X to Y" format and provide a reliable source if appropriate. {{Blue|Further message.}}
For more graphic checkmarks, see the long list of variations at :Template:Done/See also. These include:
{{Block indent |{{Div col|content=
: {{Already declined}} {{tlx|Already declined}}
: {{Already done}} {{tlx|Already done}}
: {{Deferred}} {{tlx|Deferred}}
: {{Deleted}} {{tlx|Deleted}}
: {{DuplicateProposal}} {{tlx|DuplicateProposal}}
: {{NeedsDiscussion}} {{tlx|NeedsDiscussion}}
: {{Possibly}} {{tlx|Possibly}}
: {{Redundant symbol}} {{tlx|Redundant symbol}}
: {{Removed}} {{tlx|Removed}}
: {{Reopened}} {{tlx|Reopened}}
: {{Resolved mark}} {{tlx|Resolved mark}}
: {{Reverted}} {{tlx|Reverted}}
: {{Reviewing request}} {{tlx|Reviewing request}}
: {{Undone}} {{tlx|Undone}}
: {{Unnecessary}} {{tlx|Unnecessary}}
}} }}
{{collapse bottom}}
Formatting wiki text
= Page diffs =
For an inline wikilink to a single-edit diff, only the ID of the {{em|older}} page ({{xt|oldid}}) is needed:
Special:Diff/oldid}} Special:Diff/oldid}}{{!}}this edit
gives diff between versions {{xt|Special:Diff/oldid/newid}} }} and {{xt| }}, which need not be in the same article
Likely to be piped and parenthesized on talk pages, as (diff)
{{nbsp}}– produces ({{blue|diff}}).
See also Help:Special page.
= Format title (italics, quotes) =
The fti template (short for "format title: italic") italicizes the non-parenthetical portion of a page title, and links to the given page.
- Example —
becomes Hex (Hex album){{ {{Blue|subst:fti}}|Hex (Hex album)}}
The ftq template (short for "format title: quotes") puts the non-parenthetical portion of a page title in double quotes, and links to the given page.
- Example —
becomes "24" (Game Theory song){{ {{Blue|subst:ftq}}|24 (Game Theory song)}}
These are intended for formatting article titles on disambiguation pages, and should always be subst-ed.
= Template links =
Use {{tlx|tl|Name}} (short for template link) for a link to a template page.
- Output — {{tl|Name}}
Use {{tlx|tlx|Name|param1|param2}} (template link expanded) for a link to a template page with parameters.
- Output — {{tlx|Name|param1|param2}}
- Within the parameters, {{tlx|tlx}} requires {{tlx|{{=}}}} instead of
=
To suppress execution when wikilinking to a template, add a colon at the beginning, e.g.,
.
= White space templates to replace HTML code =
To replace {{;}} and
- {{tlx|spaces|{{Blue|n}}|type}}, or redirect from {{tlx|nbsp|{{Blue|n}}|type}}
:* type=em, fig, en, thin, hair. If not specified, {{Blue|n}} non-breaking spaces (
) are produced.
:* A non-breaking space has the same width as a standard space, whose width is between the width of en and thin.
- {{tlx|br|{{Blue|n}}}} for {{Blue|n}} line breaks
- {{tlx|Block indent}} for things that aren't in lists, or where a colon doesn't work
= Fixing dated statements =
- {{tlx|Show by date|year|month|day|text before|text after|options}}
:* hour=−5 (−5 for EST, −4 for EDT, omit for UTC)
- {{tlx|As of|year|month|day|options}}
:* df=US, lc=y, since=y, alt=alternate text, pre=insertion (e.g., the first week of)
= Fixing someone else's unsigned talk page post =
{{subst: Unsigned|user name|time, day month year (UTC)}} {{subst: Unsigned IP|user IP address|time, day month year (UTC)}}
: Some experimentation yielded the good news that the time/date parameter may actually be free-form. At the least, I learned that UTC (or any time zone) is not actually required. —14:04, 16 June 2021 (UTC)
{{nbsp|2}}Example:
: Typing
will yield:
: {{Unsigned|demo=yes|Example|{{CURRENTTIME}}, {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} (UTC)}}
= Column breaks =
Automatic
Use {{tlx|Div col|colwidth{{=}}{{Blue|nn}}em}} and {{tlx|Div col end}} templates for automatically-balanced columns.
{{Div col|colwidth=30em|content=
- {{tlx|Div col|colwidth{{=}}{{Blue|nn}}em}} specifies minimum width of columns and automatically determines number of columns based on screen width. (If no colwidth is supplied, the template uses a default of 30em.)
{{ {{Blue|Div col}}|colwidth=30em|content=
:
:
:
allows the avoidance of {{tlx|Div col end}}
- {{tlx|Div col|rules{{=}}{{Blue|___}}}} adds vertical lines between columns if set to {{Blue|yes}} or to any CSS styling (e.g.,
rules={{Blue|1px dashed blue;}}
) - {{tlx|Div col|gap{{=}}{{Blue|nn}}em}} specifies spacing between columns
- {{tlx|Div col|style{{=}}{{Blue|___}}}} specifies CSS styling to apply to the columns
- {{tlx|colbegin}} and {{tlx|colend}} are redirects to these templates
}}
Manual
The {{tl|col-begin}}, {{tl|col-break}} and {{tl|col-end}} templates control columns of text on a page:
{{col-begin}}
{{col-break}}
- {{tlx|col-begin}} starts a table, and must be immediately followed by {{tl|col-break}} for the first column
- {{tlx|col-break}} triggers the start of each column
- {{tlx|col-end}} ends the multi-column table
{{col-break}}
, where{{ {{Blue|col{{nbh}}n}}}} {{Blue|n}} = 2 → 6
, replaces each occurrence of {{tl|col-break}}, with {{Blue|n}} remaining constant. It sets column width for each of {{Blue|n}} columns, with align={{Blue|left}}, valign={{Blue|top}}
:* The width, align, or valign of columns can be overridden:
.
{{col-end}}
= Message boxes =
{{col-begin}}
{{col-break}}
7 metatemplates in the Module:Message box family:
{{blist
| {{tlx|Ambox}} – article message box
| {{tlx|Cmbox}} – category message box
| {{tlx|Imbox}} – image file message box
| {{tlx|Tmbox}} – talk message box
| {{tlx|Fmbox}} – header/footer message box
| {{tlx|Ombox}} – other types of page
| {{tlx|Mbox}}{{spaces|2}} – changes presentation according to namespace
}}
{{col-break}}
Closely related metatemplates:
{{blist
| {{tlx|Asbox}} – article stub message box
| {{tlx|Dmbox}} – dab message box
| {{tlx|Ivmbox}} – simple full-width message box, default ivory bg
}}
{{col-end}}
{{Ivmbox|A full-width example generated with {{tlx|Ivmbox|A full...|Information icon4.svg}} |Information icon4.svg}}
{{Anchor|Pinned posts}}
= Collapsing a talk page discussion =
{{collapse top |warning=yes}}
{{collapse top |warning=yes}} [ ... ]
{{collapse bottom}}
{{Ivmbox|
- Summary point 1
- Summary point 2
|Information icon4.svg}} Refactored this section by collapsing the lengthy discussion. Added notice box text to summarize. ~~~~
{{collapse bottom}}
{{Ivmbox|
- Summary of lengthy discussion
- Collapsed using {{tl|Collapse top}} and {{tl|Collapse bottom}}
- To see the code that produces this, show the extended content by clicking [show] in the right margin above.
|Information icon4.svg}} Refactored this section by collapsing the lengthy discussion. Added notice box text to summarize.
= List of colors =
= Pinned posts (📌 {{Resize|75%|''pinned post''}}) =
The above is done with:
Image tricks
= CSS image crop =
{{collapse top |left=true |bg=Ivory |indent=1.6em |title=Example of {{Blue|:Template:CSS image crop}} }}
{{CSS image crop |Image = Name of the image file, or may accept {{Annotated image}}.
|bSize = Base image width in pixels (the image we are cropping on)
|cWidth = Crop image width in pixels
|cHeight = Crop image height in pixels
|oTop = Offset top in pixels, optional, defaults to 0 when omitted
|oLeft = Offset left in pixels, optional, defaults to 0 when omitted
|Location = 'right', 'left', 'center' or 'none' (determines image placement on page)
— defaults to 'right' for thumbs or when description is provided
— defaults to 'left' for non-thumbs or when description is blank
|Description = Description (will render out using thumbnail class)
|Link = Name of an article to be linked by clicking on the image (usually omit)
|Alt = Alt text for the image.
|Page = Page of the file, if there are multiple pages (such as pdf files).
|magnify-link = Image to be linked by the magnify icon (usually omit)
}}
{{collapse bottom}}
= Multiple images =
{{collapse top |left=true |bg=Ivory |indent=1.6em |title=Example of {{Blue|:Template:Multiple image}} }}
{{multiple image
| align = right
| direction = horizontal
| total_width = 300
| background color = Wheat
| header_background = White
| header = Arms of Hamilton of Grange
| image1 = Arms of Hamilton of Grange.svg
| alt1 = Hamilton of Grange arms
| caption1= Arms: Gules, a lion rampant, argent...
| image2 = Armorial of Hamilton of Grange (1823).jpg
| alt2 = Hamilton of Grange arms, crest, and motto
| caption2= Arms, crest, and motto
| footer_background = White
| footer = Arms of the Lairds of Grange in Ayrshire, Scotland, including Hamilton's paternal grandfather
}}
{{multiple image | align = right
| direction = horizontal
| total_width = 300
| background color = Wheat
| header_background = White
| header = Arms of Hamilton of Grange
| image1 = Arms of Hamilton of Grange.svg
| alt1 = Hamilton of Grange arms
| caption1= Arms: Gules, a lion rampant, argent...
| image2 = Armorial of Hamilton of Grange (1823).jpg
| alt2 = Hamilton of Grange arms, crest, and motto
| caption2= Arms, crest, and motto
| footer_background = White
| footer = Arms of the Lairds of Grange in Ayrshire, Scotland, including Hamilton's paternal grandfather
}}
{{collapse bottom}}
= Commons image cleanup requests =
To submit a cleanup request, see :commons:Media for cleanup.
- Template:Cleanup image allows a reason to be specified: {{tlx|Cleanup image |1{{=}}{{Blue|___}}}}
- If a transparent background is desired, add instead to Category:Images where background should be removed.
= Commons image crop request (or documenting) =
To submit a crop request, see :commons:Template:Crop for Wikidata.
- E.g.:
{{Crop for Wikidata |1= {{Blue|Wikidata Q item number}}|2= {{Blue|Crop instructions}}}}
{{collapse top |left=true |bg=Ivory |indent=1.6em |title=Steps to take when cropping in Commons}}
{{Ivmbox |1=It has been requested to crop a part of this image, so that the cropped part can serve as its own image for :Wikidata:Q000000.
: Example — Crop instructions: Capture a head and chest shot of the second person from the left
If you perform the crop, please
- [https://commons.wikimedia.org/w/index.php?title=&action=edit Copy] this file metadata and upload the cropped file using [https://commons.wikimedia.org/w/index.php?title=Special:Upload&uploadformstyle=basic this upload form] with extraction info appended to the source field, e.g.:
:: source = Original: http://photo-robert.tumblr.com/post/57352306647/game-theory-1989-the-last-line-up-lasted-1
:: {{tlx|Extracted from|Game Theory final line-up 1989.jpg}}
- [https://commons.wikimedia.org/w/index.php?title=&action=edit Add] extraction info to the other versions field of the origin file, e.g.:
:: other_versions =
{{tlx|Image extracted|File:Michael Quercio 1989.png}}
- Add the new file as an image to the Wikidata item, under Statements
| Image
If cropping a JPEG, it is generally preferable to use a lossless cropping tool such as [//tools.wmflabs.org/croptool?title={{FULLPAGENAMEE}} CropTool] on Wikimedia Toolforge, jpegtran, or in some cases GIMP, ImageMagick, IrfanView, XnView. For more help, see Media for cleanup.
|2=
}}
{{collapse bottom}}
Miscellany
= Rcats for redirects =
Rcats are maintenance templates used to categorize redirect pages (e.g., R from..., R to...)
:* alphabetical listing of rcat templates
- {{Tlx|R template index}} – navigation box summary
- {{Tlx|Redirect category shell}}
= Research tools for editors =
Requests and renewals at Wikipedia Library Card Platform: https://wikipedialibrary.wmflabs.org/users/
- Newspapers.com – see WP:Newspapers.com {{small|(owned by Ancestry.com)}}
- NewspaperARCHIVE.com – see WP:Newspaperarchive.com {{small|(owned by Heritage Microfilm)}}
- Fold3 – documents and images from American and British military history; see WP:Fold3 {{small|(owned by Ancestry.com)}}
HighBeam Research – see WP:HighBeam– no longer offered
= Blocked page moves =
Use :Wikipedia:Requested moves/Technical requests for uncontroversial technical requests.
= Toolbar scripts and customizations =
- User:Lwarrenwiki/common.js – now contains only scripts for adding things to toolbars or menus
- User:Lwarrenwiki/vector.js – now contains only scripts for other page rewrites
- User:Lwarrenwiki/vector.css – now contains only code for turning redirects green
- For custom signature code, see the first page of Special:Preferences, and my signature tests
= Userspace and sandbox =
Contents of my personal namespace:
- [https://en.wikipedia.org/wiki/Special:PrefixIndex?prefix=Lwarrenwiki&namespace=2 All pages under User:Lwarrenwiki] (includes css, js, userboxes, templates)
- [https://en.wikipedia.org/wiki/Special:PrefixIndex?prefix=Lwarrenwiki&namespace=3 All pages under User talk:Lwarrenwiki] (user talk archives)
- [https://en.wikipedia.org/wiki/Special:PrefixIndex?prefix=Lwarrenwiki%2Fsandbox&namespace=2 All pages under User:Lwarrenwiki/sandbox] (draft articles)
- This cheatsheet is at User:Lwarrenwiki/Cheatsheet
- New sandbox – at User:Lwarrenwiki/New sandbox, which includes the former contents of User:Lwarrenwiki/sandbox
- Old sandbox – transcludes the cheatsheet, so it can be accessed from the top menu "Sandbox" link