Template:nophoto

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(add helpful caption message (which gets overloaded by the link) and "support" for captions; add a few more examples)
(turn this into a div to add overlay text. Not sure how to turn the link text more red.)
Line 1: Line 1:
-
[[Image:Nophoto.PNG|{{{1|150px}}}|Please contribute to the wiki by uploading a file to replace this placeholder.|link={{#if:{{{filename|}}}|{{SERVER}}{{localurl:Special:Upload|wpDestFile={{{filename}}}}}|Special:Upload}}]]<!--
+
{{#setvar:nophoto_message|Please contribute to the wiki by uploading a file to replace this placeholder.}}<!--
-
--><includeonly>[[Category:Articles Needing Images]]</includeonly><noinclude>
+
  /* store message in a variable */
 +
-->{{#setvar:nophoto_link|{{SERVER}}{{#if:{{{filename|}}}|{{localurl:Special:Upload|wpDestFile={{{filename}}}}}|{{localurl:Special:Upload}} }} }}<!--
 +
  /* store link target in a variable */
 +
--><div style="width: {{{1|150px}}}; position: relative;"><!--
 +
  /* source: https://stackoverflow.com/questions/44275502/overlay-text-on-image-html */
 +
--><span style="width: 100%;">[[Image:Nophoto.PNG<!--
 +
  -->|{{{1|150px}}}<!--
 +
  -->|{{#var:nophoto_message}}<!--
 +
  -->|link={{#var:nophoto_link}}<!--
 +
-->]]</span><!--
 +
--><span style="position: absolute;bottom:0px; right:0px;"><center><small><!--
 +
  --><span class="plainlinks" style="color:#FF0000;">[{{#var:nophoto_link}} {{#var:nophoto_message}}]</span><!--
 +
--></small></center></span><!--
 +
--></div><includeonly>[[Category:Articles Needing Images]]</includeonly><noinclude>
-
This template is used to mark items that expect a photo but do not have them.
+
This template is used to mark items that expect a photo but do not have them.
These are added to the [[:Category:Articles Needing Images|Articles Needing Images]] category.
These are added to the [[:Category:Articles Needing Images|Articles Needing Images]] category.

Revision as of 02:50, 26 December 2022

Please contribute to the wiki by uploading a file to replace this placeholder.
Please contribute to the wiki by uploading a file to replace this placeholder.

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.

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 meant for the image to help future editors:
{{nophoto|caption=witty description goes here}}
  • These options can be combined:
{{nophoto|100px|filename=newCoolPic.PNG|caption=witty description goes here}}
Personal tools