Template:nophoto

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(Seems color style needs to be inside the link. A lighter color might look better against the dark grey. Text could have tighter leading too but unsure how to do that)
(urlencode should help resolve the issue with spaces in filenames)
 
(includes 9 intermediate revisions)
Line 1: Line 1:
-
{{#setvar:nophoto_message|Please contribute to the wiki by uploading a file to replace this placeholder.}}<!--  
+
<!-- /* store link target in a variable */
-
  /* store message in a variable */
+
-->{{#setvar:nophoto_link|{{SERVER}}{{#if:{{{filename|}}}|{{localurl:Special:Upload|wpDestFile={{urlencode:{{{filename}}}}}}}|{{localurl:Special:Upload}} }} }}<!--  
-
-->{{#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 */
   /* source: https://stackoverflow.com/questions/44275502/overlay-text-on-image-html */
-
--><span style="width: 100%;">[[Image:Nophoto.PNG<!--
+
--><div style="width: {{{1|150px}}}; position: relative;">[[Image:Nophoto.PNG<!--
   -->|{{{1|150px}}}<!--
   -->|{{{1|150px}}}<!--
-
  -->|{{#var:nophoto_message}}<!--
+
   -->|link={{#var:nophoto_link}}]]<!--
-
   -->|link={{#var:nophoto_link}}<!--
+
--><div class="plainlinks hovul" style="box-sizing:border-box;width:{{{1|150px}}};padding:10px;position:absolute;bottom:0px;left:0;text-align:center;font-size:90%;line-height:1.3">[{{#var:nophoto_link}} <span style="color:#FF5555; text-shadow: 1px 1px black;">{{{caption|Click here to upload an image}}}</span>]</div></div><includeonly>[[Category:Articles Needing Images]]</includeonly><noinclude>
-
-->]]</span><!--
+
-
--><span style="position: absolute;bottom:0px; right:0px;"><center><small><!--
+
-
  --><span class="plainlinks">[{{#var:nophoto_link}} <span style="color:#FF6666;">{{#var:nophoto_message}}</span>]</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.
Line 32: Line 24:
{{nophoto|filename=newCoolPic.PNG}}
{{nophoto|filename=newCoolPic.PNG}}
</pre>
</pre>
-
* To enter a caption meant for the image to help future editors:
+
* To enter a caption different from the default:
<pre>
<pre>
-
{{nophoto|caption=witty description goes here}}
+
{{nophoto|caption=Please donate images to help The Sad Kids.}}
</pre>
</pre>
* These options can be combined:
* These options can be combined:
<pre>
<pre>
-
{{nophoto|100px|filename=newCoolPic.PNG|caption=witty description goes here}}
+
{{nophoto|filename=newCoolPic.PNG|100px|caption=Upload image}}
</pre>
</pre>
-
[[Category:Simple Formatting Templates]]
+
[[Category:Fancy Formatting Templates]]
 +
[[Category:Image Formatting Templates]]
</noinclude>
</noinclude>

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}}
Personal tools