Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Template:Imageexists

From Data Crystal
Revision as of 04:15, 24 January 2024 by Hawk (talk | contribs) (Created page with "<includeonly>{{#ifexist: File:{{{file}}} | [[File:{{{file}}}{{ #if: {{{width|}}} | {{!}}{{{width}}} | }}{{ #if: {{{caption|}}} | {{!}}{{{caption}}} | }}]] | link={{fullurl:Special:Upload|wpDestFile={{{file}}}}}|Click to upload a new image...{{#if: {{{mcat|}}} | [[Category:{{{mcat}}}|{{PAGENAME}}]] | }}<span style="display: none;">[[Media:{{{file}}}|Dummy link]]</span>}}</includeonly><noinclude> Syntax time: <pre>{{imageexists |file = filename.pn...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax time:

{{imageexists
|file    = filename.png
|width   = 256px
|caption = derp
|mcat    = Missing images
}}

Usage: Given file (the only real required attribute), will either show that file, or (if it doesn't exist) a placeholder that links to the file uploader, pre-set for that filename. Upon uploading it the image will display the new upload.

The main intended use of this is bob, though it could probably find some use elsewhere if you tried really hard.

  • width: width of uploaded image (note that the placeholder will always be normal size)
  • caption: Wit.
  • mcat: The category to place the page into when the file does not exist.