Template:Image/sandbox
| This is the template sandbox page for Template:Image (diff). See also the companion subpage for test cases. |
| This template is used on approximately 381,000 pages. 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. Consider discussing changes on the talk page before implementing them. |
| This template uses Lua: |
This makes for a quick and easy way to add an image to a Wikispecies page, with common default values.
Usage
[edit]- {{image}} – get image filename from Wikidata (if available)
- {{image|image filename}} – specify the file to use
The size (it will default to the user's thumbnail size preference) and/or description (the default value is generated from Wikidata with a fallback of {{PAGENAME}}) can be changed too, using the 2nd and 3rd parameters, but only if the image is explicitly defined. Examples:
- {{image|Example.jpg|280}}
- {{image|Example.jpg|caption}}
- {{image|Example.jpg|280|caption}}
- {{image|Example.jpg|caption|280}}
When available and no caption is specified, Wikidata is leveraged to create the caption. The template will:
- use the P180 "depicts" qualifier to produce a more accurate caption, including a link to the depicted taxon's Wikispecies page. This should be set as a qualifier on the taxon's P18 "image" statement, and used for supraspecific taxa to tie the image to the individual species depicted.
- use the P225 "taxon name" statement for the caption text. Links will still go to the correct page on Wikispecies, even if the taxon name and page name are different.
- italicize taxon names for genus and lower, while keeping suprageneric taxa in roman type.
- use the P21 "sex or gender" qualifier to add (♀) or (♂) to the caption. This should be set as a qualifier on the taxon's P18 "image" statement with a value of either Q44148 "male organism" or Q43445 "female organism".
- add Category:Pages with incomplete image labeling to the page for supraspecific taxa without a "depicts" qualifier available. This is intended to facilitate manual review and cleanup.
If an image is specified without a caption, the template will still use relevant information from Wikidata when creating the caption. If the image specified on Wikispecies is also given on Wikidata as one of the taxon's P18 "image" statements, the template will use that statement's depicts and sex qualifiers. You can use this behavior when a taxon has more than one image on Wikidata to select which one you'd like to use here on Wikispecies, while still getting the correct automatic caption.
A note on Wikidata changes: watching a page on Wikispecies will not, by default, automatically tell you when a change on Wikidata alters the image or caption for that page. To catch these changes, you can opt in by enabling Special:Preferences → Watchlist → "Show Wikidata edits in your watchlist". This will add changes to the Wikidata entity to your Wikispecies watchlist. Two caveats:
- You'll see all changes to the Wikidata entity, not just the image-related ones.
- It will only add these edits to your watchlist, not message you via the Notifications tool.