Template:post

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(fix parameter name in help text and move alt text above deleted text)
(Happy New Year! Finally update template with latest changes from User:Stux/template-sandbox! (Hopefully I don't break anything...))
Line 1: Line 1:
-
{{#switch:{{{1|}}}|=|#default=
+
<!--
-
{{#switch:{{{2|}}}|={{!}}}|top=}}{{#resetcount:}}}}
+
  /***************************/
-
{{#switch:{{#COUNT:}}|#default=|1=
+
  /*  Auto insert header    */
-
{{clear}}
+
  /***************************/
-
{{#switch:{{PAGENAME}}|@strongbadactual (Instagram)=<h2>{{{1|{{CURRENTYEAR}}}}}</h2>|#default=<h2>{{{1|{{#time: F}}}}}</h2>}}
+
-->{{#if:{{#var:postTemplateNeedHeaderFlag}}||{{#setvar:postTemplateNeedHeaderFlag|false}}}}<!-- /* Flag: do we need to autoinsert a header? Default: no. */
-
{{{!}} width=100% border=1 cellspacing=0 cellpadding=3 style="border-collapse:collapse"
+
-->{{#if:{{{1|}}}<!-- /* check to see if old-style month parameter is set. */
-
{{!}}- bgcolor=#eeeeee
+
-->|
-
! class="unsortable" colspan=2{{!}} Text / Transcript
+
{{#switch:{{{2|}}}|={{!}}}|top=}}<!-- /* This is a single line of code that adds a "|}" tag for the old style. */
-
! width=100{{!}} Date / Link}}
+
-->{{#setvar:postTemplateNeedHeaderFlag|true}}<!--(debug0-{{#var:postTemplateNeedHeaderFlag}})--><!-- /* Flag: mark header as needed for insertion. */
-
|- id="{{{id|}}}" {{#if:{{{reply|}}}|style="background:#F9F9F9"|}}
+
-->|}}<!-- /*end {{#if:{{{1|}}} */
 +
 
 +
-->
 +
{{#if:{{{table-begin|<noinclude>true</noinclude>}}}<!-- /*
 +
    NOTE: there are now three ways to include the header;
 +
          A. We explicitly mark the beginning of a table using the table-begin parameter
 +
          B. Manually call {{post-table-header}} outside of this template (preferred for ongoing updates)
 +
          C. The old way by using the {{{1}}} parameter w/ the month.
 +
    NOTE 2: noinclude is used above so header is shown in this template's page.
 +
*/
 +
-->|<!--(debug1a-{{#var:postTemplateNeedHeaderFlag}})-->{{#setvar:postTemplateNeedHeaderFlag|false}}{{post-table-header}}<!--
 +
-->|{{#ifeq:{{#var:postTemplateNeedHeaderFlag}}|true|<!-- /* check if autoinsert flag is set */ -->
 +
{{clear}}<!--(debug1b-{{#var:postTemplateNeedHeaderFlag}})-->
 +
{{#switch:{{post-getType|{{{site|}}} }}<!-- /* code to auto-post h2 header based on page name */
 +
  -->|Instagram=<h2>{{{1|{{CURRENTYEAR}}}}}</h2><!--
 +
  -->|Twitter=<h2>{{{1|{{#time: F}}}}}</h2><!--
 +
-->}}
 +
{{#setvar:postTemplateNeedHeaderFlag|false}}{{post-table-header}}<!--  
 +
-->|<!--(debug1c-{{#var:postTemplateNeedHeaderFlag}})-->}}<!--/*end #ifeq:postTemplateNeedHeaderFlag */
 +
-->}}<!-- /*end #if:{{{table-begin|}}} */  
 +
 
 +
--><!--(debug2-{{#var:postTemplateNeedHeaderFlag}})--><!--
 +
  /***************************/
 +
  /* Start Body of the table */
 +
  /***************************/
 +
-->
 +
|- id="{{{id|}}}" {{#if:{{{reply|}}}|style="background:#F9F9F9"|}}<!-- /* single line of code to style replies */ -->
|width="200px" <!--
|width="200px" <!--
-
-->{{#switch:{{{pic|}}}|=colspan=2{{!}}|#default=align=center{{!}}<!--
+
 
 +
--><!--
 +
  /***** Image Section *****/
 +
-->{{#if:{{{pic|}}}<!--
 +
-->|align=center{{!}}<!--
-->{{post-pic|{{{pic|}}}|size={{{size|}}}|date={{{date|}}}|{{{site|}}}|isvideo={{{video transcript|}}}|isFirst=1}}<!--
-->{{post-pic|{{{pic|}}}|size={{{size|}}}|date={{{date|}}}|{{{site|}}}|isvideo={{{video transcript|}}}|isFirst=1}}<!--
-->{{post-pic|{{{pic2|}}}|size={{{size2|}}}|date={{{date|}}}|{{{site|}}}}}<!--
-->{{post-pic|{{{pic2|}}}|size={{{size2|}}}|date={{{date|}}}|{{{site|}}}}}<!--
Line 17: Line 47:
-->{{post-pic|{{{pic5|}}}|size={{{size5|}}}|date={{{date|}}}|{{{site|}}}}}
-->{{post-pic|{{{pic5|}}}|size={{{size5|}}}|date={{{date|}}}|{{{site|}}}}}
-
{{!}}}}<!--
+
{{!}}<!--
 +
-->|colspan=2{{!}}<!--
 +
-->}}<!-- /*end {{#if:{{{pic|}}} */
 +
 
 +
--><!--
 +
  /***** Pinned Tweet Section *****/
-->{{#if:{{{pinned|}}}|
-->{{#if:{{{pinned|}}}|
:<p style="color:#5B7083">[[File:PinnedTweet.png|x15px]] ''This Tweet was pinned.''</p>
:<p style="color:#5B7083">[[File:PinnedTweet.png|x15px]] ''This Tweet was pinned.''</p>
-
<br>
+
<br />
-
|}}<!--
+
|}}<!-- /*end {{#if:{{{pinned|}}} */
-
-->{{#switch:{{{retweet|}}}<!--
+
 
-
   -->|={{#if:{{{text|}}}<!--
+
--><!--
 +
  /***** Retweet Section *****/
 +
-->{{#if:{{{retweet|}}}<!--
 +
   -->|''This is a Retweet of {{{retweet|}}} ''<!--
 +
  -->|{{#if:{{{text|}}}<!--
     -->|<div style="font-size:120%">{{{text|}}}</div><!--
     -->|<div style="font-size:120%">{{{text|}}}</div><!--
     -->|<p style="font-style:italic;font-size:85%;color: #aaa">(no text)</p><!--
     -->|<p style="font-style:italic;font-size:85%;color: #aaa">(no text)</p><!--
   -->}}<!--
   -->}}<!--
-
  -->|#default=''This is a Retweet of {{{retweet|}}} ''<!--
+
-->}}<!-- /*end {{#if:{{{retweet|}}} */
-
-->}}<!--
+
 
 +
--><!--
 +
  /***** Film Section *****/
 +
-->{{#if:{{{film1|{{{film|}}}}}}|<!-- if either film1 or film are defined -->
 +
<br />
 +
:<p>'''Cast:''' {{post-film|{{{film1|}}}|first=true}}<!--
 +
-->{{post-film|{{{film2|}}}}}<!--
 +
-->{{post-film|{{{film3|}}}}}<!--
 +
-->{{post-film|{{{film4|}}}}}<!--
 +
-->{{post-film|{{{film5|}}}}}<!--
 +
-->{{post-film|{{{film|}}}|maybefirst={{{film1|}}}|first=true|textonly=true}}</p>
 +
|}}
 +
<!-- /*end {{#if:{{{film1|}}} */
 +
 
 +
--><!--
 +
  /***** "This X" Section *****/
-->{{post-this|{{{link|}}}|t={{spc}}links to {{{link|}}}|{{{site|}}}}}<!--
-->{{post-this|{{{link|}}}|t={{spc}}links to {{{link|}}}|{{{site|}}}}}<!--
-->{{post-this|{{{reply|}}}|t={{spc}}is a reply to {{{reply|}}}|{{{site|}}}}}<!--
-->{{post-this|{{{reply|}}}|t={{spc}}is a reply to {{{reply|}}}|{{{site|}}}}}<!--
Line 35: Line 89:
-->{{post-this|{{{altdesc|}}}|t='s '''Image Description''' reads:<br/>{{{altdesc|}}}|{{{site|}}}}}<!--
-->{{post-this|{{{altdesc|}}}|t='s '''Image Description''' reads:<br/>{{{altdesc|}}}|{{{site|}}}}}<!--
-->{{post-this|{{{deleted|}}}|t={{spc}}has been deleted.|{{{site|}}}}}<!--
-->{{post-this|{{{deleted|}}}|t={{spc}}has been deleted.|{{{site|}}}}}<!--
 +
--><!--
 +
 +
  /***** Special Subsections *****/
-->{{post-subsection|{{{image transcript|}}}|name=Image Transcript}}<!--  
-->{{post-subsection|{{{image transcript|}}}|name=Image Transcript}}<!--  
-->{{post-subsection|{{{video transcript|}}}|name=Video Transcript}}<!--
-->{{post-subsection|{{{video transcript|}}}|name=Video Transcript}}<!--
Line 40: Line 97:
-->{{post-subsection|{{{poll|}}}|name=Poll Options}}<!--  
-->{{post-subsection|{{{poll|}}}|name=Poll Options}}<!--  
-->{{post-subsection|{{{fun facts|}}}|name=Fun Facts}}
-->{{post-subsection|{{{fun facts|}}}|name=Fun Facts}}
-
|{{#if:{{{deleted|}}}<!--  
+
<!--
 +
 
 +
--><!--
 +
  /***** Date Section *****/
 +
-->|{{#if:{{{deleted|}}}<!--  
   -->|{{{date|Date}}}<!--  
   -->|{{{date|Date}}}<!--  
-
   -->|{{#switch:{{{site|{{PAGENAME}}}}}<!--  
+
   -->|{{#switch:{{post-getType|{{{site|}}} }}<!--  
-
     -->|#default=[[twitter:StrongBadActual/status/{{{id|}}}|{{{date|Date}}}]]<!--  
+
     -->|Twitter=[[twitter:StrongBadActual/status/{{{id|}}}|{{{date|Date}}}]]<!--  
-
     -->|@strongbadactual (Instagram)=[[instagram:p/{{{id|}}}/|{{{date|Date}}}]]<!--
+
     -->|Instagram=[[instagram:p/{{{id|}}}/|{{{date|Date}}}]]<!--
   -->}}<!--  
   -->}}<!--  
-
-->}}<noinclude>
+
-->}}<!-- /*end {{#if:{{{deleted|}}} */
-
|}<span style="display:none">{{{film|}}}</span>
+
 
 +
 
 +
--><!--
 +
  /***** Handle Table Closing *****/
 +
-->{{clear}}{{post-table-end|{{{table-end|}}}}}<!--
 +
 
 +
--><noinclude>
 +
|}
 +
<!--
 +
  /***************************/
 +
  /*  End of Template Code  */
 +
  /***************************/
 +
-->
===How to use the template===
===How to use the template===
<pre>
<pre>
{{post
{{post
-
|id=The number at the end of the post's URL (for example, 913122813711708161). This is used for two reasons{{--}} links to the section on the page ([[@StrongBadActual Tweets 2014#913122813711708161]]) and the URL in the Link column.
+
|table-begin=1
-
|site=For differentiating Twitter or Instagram posts. DO NOT USE unless absolutely necessary, as this template is programmed to match the page it's on.
+
    /* Indicates this is the first item on the table and a table header needs to be built! */
 +
    NOTE: Instead of using this flag, the {{post-table-header}} template can also be inserted
 +
    above the first entry of this template for the month.
 +
|id=The number at the end of the post's URL (for example, 913122813711708161).  
 +
    This is used for two purposes:
 +
      creating anchor links to the section on the page (e.g. [[@StrongBadActual Tweets 2014#913122813711708161]])  
 +
      and generating the Twitter URL in the Link column.
 +
|site=For differentiating Twitter or Instagram posts. DO NOT USE unless  
 +
    absolutely necessary, as this template is programmed to match the page it's on.
|pic=The post's image or a video thumbnail.
|pic=The post's image or a video thumbnail.
|pic2=A second image.
|pic2=A second image.
Line 59: Line 140:
|pic4=A fourth image.
|pic4=A fourth image.
|pic5=A fifth image.
|pic5=A fifth image.
-
|size=For changing the size of the image. Again, DO NOT USE unless there is a good reason, as the images are automatically formatted to be 200 pixels wide (188 for videos, due to the filmstrip border).
+
|size=For changing the size of the image. Again, DO NOT USE unless there is a  
 +
    good reason, as the images are automatically formatted to be 200 pixels wide  
 +
    (188 for videos, due to the filmstrip border).
|size2=Size of the second image.
|size2=Size of the second image.
|size3=Size of the third image.
|size3=Size of the third image.
Line 67: Line 150:
|text=The text of the post.
|text=The text of the post.
|link=If the post is a link, put the link information here.
|link=If the post is a link, put the link information here.
-
|quote=If the post is a Quote Tweet, put any additional information here, including the person who posted what was linked to, and a paraphrase of what they posted.
+
|quote=If the post is a Quote Tweet, put any additional information here,  
-
|reply=If the post is a reply, put any additional information here, including the person who was replied to, and a paraphrase of what they posted.
+
    including the person who posted what was linked to, and a paraphrase  
-
|refer=If the post refers to someone else's, but does not link to it, put any additional information here (such as a link to the post that was referenced).
+
    of what they posted.
-
|altdesc=If the post contains an alternate image description as defined here: https://help.twitter.com/en/using-twitter/how-to-use-alt-gif
+
|reply=If the post is a reply, put any additional information here, including  
-
|deleted=If the post has been deleted, put something here (for example, "yes" or "true").
+
    the person who was replied to, and a paraphrase of what they posted.
-
|retweet=If a post is Retweeted with no additional text, put the username and content type here (for example, "@trogdorgame's video").
+
|refer=If the post refers to someone else's, but does not link to it, put  
 +
    any additional information here (such as a link to the post that was referenced).
 +
|altdesc=If the post contains an alternate image description as defined  
 +
    here: https://help.twitter.com/en/using-twitter/how-to-use-alt-gif
 +
|deleted=If the post has been deleted, put something here  
 +
    (for example, "yes" or "true").
 +
|retweet=If a post is Retweeted with no additional text, put the username  
 +
    and content type here (for example, "@trogdorgame's video").
|image transcript=Transcribing the image if there is any text in it.
|image transcript=Transcribing the image if there is any text in it.
|video transcript=Transcribing the video.
|video transcript=Transcribing the video.
Line 79: Line 169:
|fun facts=Fun facts regarding the post.
|fun facts=Fun facts regarding the post.
|date=The date of the post.
|date=The date of the post.
-
|film=Characters who appeared in the post.
+
|film1=First Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
 +
|film2=Second Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
 +
|film3=Third Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
 +
|film4=Fourth Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
 +
|film5=Fifth Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
 +
|film=General list of Characters who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
 +
|table-end=1
 +
    /* Indicates this is the last item on the table and a table footer needs to be built! */
}}
}}
</pre>
</pre>
 +
 +
===See Also===
 +
The following helper templates are used:
 +
*{{t|post-table-header}}
 +
*{{t|post-getType}}
 +
*{{t|post-getTypeName}}
 +
*{{t|post-pic}}
 +
*{{t|post-this}}
 +
*{{t|post-subsection}}
 +
*{{t|post-film}}
 +
*{{t|post-table-end}}
 +
[[Category:Toon Article Formatting Templates|{{PAGENAME}}]]</noinclude>
[[Category:Toon Article Formatting Templates|{{PAGENAME}}]]</noinclude>

Revision as of 09:18, 1 January 2023

Text / Transcript Date / Link

(no text)

Date

How to use the template

{{post
|table-begin=1
    /* Indicates this is the first item on the table and a table header needs to be built! */
    NOTE: Instead of using this flag, the {{post-table-header}} template can also be inserted 
    above the first entry of this template for the month.
|id=The number at the end of the post's URL (for example, 913122813711708161). 
    This is used for two purposes:
      creating anchor links to the section on the page (e.g. [[@StrongBadActual Tweets 2014#913122813711708161]]) 
      and generating the Twitter URL in the Link column.
|site=For differentiating Twitter or Instagram posts. DO NOT USE unless 
    absolutely necessary, as this template is programmed to match the page it's on.
|pic=The post's image or a video thumbnail.
|pic2=A second image.
|pic3=A third image.
|pic4=A fourth image.
|pic5=A fifth image.
|size=For changing the size of the image. Again, DO NOT USE unless there is a 
    good reason, as the images are automatically formatted to be 200 pixels wide 
    (188 for videos, due to the filmstrip border).
|size2=Size of the second image.
|size3=Size of the third image.
|size4=Size of the fourth image.
|size5=Size of the fifth image.
|pinned=Set to a non-blank value if the Tweet has been pinned.
|text=The text of the post.
|link=If the post is a link, put the link information here.
|quote=If the post is a Quote Tweet, put any additional information here, 
    including the person who posted what was linked to, and a paraphrase 
    of what they posted.
|reply=If the post is a reply, put any additional information here, including 
    the person who was replied to, and a paraphrase of what they posted.
|refer=If the post refers to someone else's, but does not link to it, put 
    any additional information here (such as a link to the post that was referenced).
|altdesc=If the post contains an alternate image description as defined 
    here: https://help.twitter.com/en/using-twitter/how-to-use-alt-gif
|deleted=If the post has been deleted, put something here 
    (for example, "yes" or "true").
|retweet=If a post is Retweeted with no additional text, put the username 
    and content type here (for example, "@trogdorgame's video").
|image transcript=Transcribing the image if there is any text in it.
|video transcript=Transcribing the video.
|live video transcript=Transcribing a live video.
|poll=If a poll is posted, put the options here.
|fun facts=Fun facts regarding the post.
|date=The date of the post.
|film1=First Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
|film2=Second Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
|film3=Third Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
|film4=Fourth Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
|film5=Fifth Character who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
|film=General list of Characters who appeared in the post. (**DO NOT INCLUDE STRONG BAD!**)
|table-end=1
    /* Indicates this is the last item on the table and a table footer needs to be built! */
}}

See Also

The following helper templates are used:

Personal tools