Template:nophoto
From Homestar Runner Wiki
(Difference between revisions)
(I think this no longer counts as a simple template; also add to image template category) |
(urlencode should help resolve the issue with spaces in filenames) |
||
(includes 1 intermediate revision) | |||
Line 1: | Line 1: | ||
<!-- /* store link target in a variable */ | <!-- /* store link target in a variable */ | ||
- | -->{{#setvar:nophoto_link|{{SERVER}}{{#if:{{{filename|}}}|{{localurl:Special:Upload|wpDestFile={{{filename}}}}}|{{localurl:Special:Upload}} }} }}<!-- | + | -->{{#setvar:nophoto_link|{{SERVER}}{{#if:{{{filename|}}}|{{localurl:Special:Upload|wpDestFile={{urlencode:{{{filename}}}}}}}|{{localurl:Special:Upload}} }} }}<!-- |
/* source: https://stackoverflow.com/questions/44275502/overlay-text-on-image-html */ | /* source: https://stackoverflow.com/questions/44275502/overlay-text-on-image-html */ | ||
--><div style="width: {{{1|150px}}}; position: relative;">[[Image:Nophoto.PNG<!-- | --><div style="width: {{{1|150px}}}; position: relative;">[[Image:Nophoto.PNG<!-- | ||
Line 30: | Line 30: | ||
* These options can be combined: | * These options can be combined: | ||
<pre> | <pre> | ||
- | {{nophoto | + | {{nophoto|filename=newCoolPic.PNG|100px|caption=Upload image}} |
</pre> | </pre> | ||
Current revision as of 10:41, 22 April 2025
This template is used to mark items that expect a photo but do not have them.
These are added to the Articles Needing Images category.
[edit] Usage
- To add an image with a default width of 150px:
{{nophoto}}
- To add an image with a width of 100px:
{{nophoto|100px}}
- To link to a specific desired filename:
{{nophoto|filename=newCoolPic.PNG}}
- To enter a caption different from the default:
{{nophoto|caption=Please donate images to help The Sad Kids.}}
- These options can be combined:
{{nophoto|filename=newCoolPic.PNG|100px|caption=Upload image}}