Template:postref

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(add support for ronginald links; use post-getType template to facilitate site name detection, but ensure twitter remains the default)
(add new "posted on" wording)
Line 1: Line 1:
-
{{#switch:{{post-getType|{{{site|Twitter}}}}}<!-- /* choose target page and heading */
+
{{#if:{{{posted|}}}<!--
 +
-->|{{#switch:{{post-getType|{{{site|Twitter}}}}}<!-- /* choose target page and heading */
 +
  -->|Instagram=[[@strongbadactual (Instagram)|posted]] to Instagram <!--
 +
  -->|ronginald=[[@ronginald|posted]] to Twitter<!--
 +
  -->|#default=[[@StrongBadActual|posted]] to Twitter<!--
 +
-->}} on {{b}}<!--
 +
-->|{{#switch:{{post-getType|{{{site|Twitter}}}}}<!-- /* choose target page and heading */
   -->|Instagram=[[@strongbadactual (Instagram)|@strongbadactual]] Instagram post<!--  
   -->|Instagram=[[@strongbadactual (Instagram)|@strongbadactual]] Instagram post<!--  
   -->|ronginald=[[@ronginald]] Tweet<!--  
   -->|ronginald=[[@ronginald]] Tweet<!--  
   -->|#default=[[@StrongBadActual]] Tweet<!--  
   -->|#default=[[@StrongBadActual]] Tweet<!--  
-
-->}} (<!--  
+
-->}} (<!-- /* end {{#switch:}} */
-
-->{{prs|{{{1|{{{ID}}}}}}|{{{2|{{{day}}}}}}|{{{3|{{{month}}}}}}|{{{4|{{{year}}}}}}|site={{{site|}}}<!--  
+
-->}}<!-- /* end {{#if:{{{posted|}}} */
-
-->}})<noinclude>
+
-->{{prs|{{{1|{{{ID}}}}}}|{{{2|{{{day}}}}}}|{{{3|{{{month}}}}}}|{{{4|{{{year}}}}}}|site={{{site|}}}|full={{{posted|}}}<!--  
 +
-->}}{{#if:{{{posted|}}}||)}}<!-- /* posted does not use parenthesis around {{prs}} */
 +
--><noinclude>
==Usage==
==Usage==
<code><nowiki>{{postref|1254408772249845763|26|Apr|2020}}</nowiki></code>
<code><nowiki>{{postref|1254408772249845763|26|Apr|2020}}</nowiki></code>
Line 16: Line 24:
{{postref|ID=1254408772249845763|day=26|month=Apr|year=2020}}
{{postref|ID=1254408772249845763|day=26|month=Apr|year=2020}}
 +
 +
Or with the "posted" parameter:
 +
 +
<code><nowiki>{{postref|1254408772249845763|26|Apr|2020|posted=1}}</nowiki></code><br>
 +
{{postref|1254408772249845763|26|Apr|2020|posted=1}}
Or for Instagram posts:
Or for Instagram posts:

Revision as of 12:44, 10 January 2023

@StrongBadActual Tweet ([[@StrongBadActual Tweets {{{year}}}#{{{ID}}}|{{{day}}} {{{month}}} {{{year}}}]])

Usage

{{postref|1254408772249845763|26|Apr|2020}}

Or with labelled parameters:

{{postref|ID=1254408772249845763|day=26|month=Apr|year=2020}}

Produces the following result:

@StrongBadActual tweet (26 Apr 2020)

Or with the "posted" parameter:

{{postref|1254408772249845763|26|Apr|2020|posted=1}}
posted to Twitter on April 26, 2020

Or for Instagram posts:

{{postref|site=Instagram|BzWAeVkAAme|30|Jun|2019}}
@strongbadactual Instagram post (30 Jun 2019)

Or for @ronginald historical posts:

{{postref|site=ronginald|114395585209053184|15|Sep|2011}}
@ronginald tweet (15 Sep 2011)

See Also

  • Template {{prs}} for shorter links
  • Uses {{post-getType}} to determine post type.
Personal tools