Template:prs

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
m (format structure of the code (and switch to #if for alt))
(add support for ronginald links; use post-getType template to facilitate site name detection, but ensure twitter remains the default)
Line 1: Line 1:
[[<!--  
[[<!--  
-
-->{{#ifeq:{{{site|}}}|<!-- /* choose target page */
+
-->{{#switch:{{post-getType|{{{site|Twitter}}}}}<!-- /* choose target page */
-
   -->|@StrongBadActual Tweets {{{4|{{{year}}}}}}<!--
+
   -->|Instagram=@strongbadactual (Instagram)<!--
-
  -->|@strongbadactual (Instagram)<!--  
+
  -->|ronginald=@ronginald<!--
 +
  -->|#default=@StrongBadActual Tweets {{{4|{{{year}}}}}}<!--  
-->}}<!--  
-->}}<!--  
-->#{{{1|{{{ID}}}}}}<!-- /* target anchor */
-->#{{{1|{{{ID}}}}}}<!-- /* target anchor */
Line 11: Line 12:
-->]]<noinclude>
-->]]<noinclude>
-
This template handles the short link portion of {{tl|postref}}.
+
This template handles the short link portion of {{tl|postref}}.  Uses {{tl|post-getType}} to determine post type.
==Usage==
==Usage==
<code><nowiki>{{prs|1254408772249845763|26|Apr|2020}}</nowiki></code>
<code><nowiki>{{prs|1254408772249845763|26|Apr|2020}}</nowiki></code>

Revision as of 21:34, 3 January 2023

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

This template handles the short link portion of {{postref}}. Uses {{post-getType}} to determine post type.

Usage

{{prs|1254408772249845763|26|Apr|2020}}

Or with labelled parameters:

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

Produces the following result:

26 Apr 2020

Or for Instagram posts:

{{prs|site=Instagram|BzWAeVkAAme|30|Jun|2019}}
30 Jun 2019

If you want to use an alternate message:

{{prs|1254408772249845763|26|Apr|2020|alt=this is a tweet link}}

Produces the following result:

this is a tweet link

Personal tools