User:Stux/template-sandbox2
From Homestar Runner Wiki
(Difference between revisions)
(work on @ template) |
(format and comment template code) |
||
| Line 1: | Line 1: | ||
| - | {{#ifeq:{{{1|}}}|#|{{#ifeq:{{{site|{{#ifeq:{{PAGENAME}}|@strongbadactual (Instagram)|Instagram|Twitter}}}}}|Instagram|[[instagram:explore/tags/{{{2}}}/|#{{{2}}}]]|[[Twitter:hashtag/{{{2}}}|#{{{2}}}]]}}<!-- | + | {{#ifeq:{{{1|}}}|#|<!-- |
| - | + | /* Handle Hashtag Links */ | |
| - | -->|[[{{{site|{{#ifeq:{{PAGENAME}}|@strongbadactual (Instagram)|Instagram|Twitter}}}}}:{{{1}}}{{#if:{{{2|}}}|/status/{{{2|}}}|}}|{{{3|@{{{1}}}}}}]]}}<noinclude> | + | -->{{#ifeq:{{{site|{{#ifeq:{{PAGENAME}}|@strongbadactual (Instagram)|Instagram|Twitter}}}}}|Instagram<!-- /* Instagram or Twitter? */ |
| + | -->|[[instagram:explore/tags/{{{2}}}/|#{{{2}}}]]<!-- /* Instagram */ | ||
| + | -->|[[Twitter:hashtag/{{{2}}}|#{{{2}}}]]<!-- /* Twitter */ | ||
| + | -->}}<!-- /* end {{#ifeq:{{{site|... */ | ||
| + | /* Handle regular links */ | ||
| + | -->|[[{{{site|{{#ifeq:{{PAGENAME}}|@strongbadactual (Instagram)|Instagram|Twitter}}}}}:{{{1}}}{{#if:{{{2|}}}|/status/{{{2|}}}|}}|{{{3|@{{{1}}}}}}]]<!-- /* Hard to parse, hard to split... But the "site" portion is the same as "Instagram or Twitter" above! */ | ||
| + | -->}}<!-- /* end {{#ifeq|{{{1|}}}... */ | ||
| + | --><noinclude> | ||
=== Usage === | === Usage === | ||
Revision as of 12:25, 9 June 2025
[[Twitter:{{{1}}}|@{{{1}}}]]
Usage
{{@|username|Tweet ID|link text|site=site}}{{@|#|hashtag text|site=site}}
Examples
{{@|StrongBadActual}}returns @StrongBadActual{{@|StrongBadActual|1349242412129017856|Tweet}}returns Tweet{{@|StrongBadActual|site=Instagram}}returns @StrongBadActual- This feature is incompatible with most other template parameters.
- On @strongbadactual (Instagram), the site defaults to Instagram. Elsewhere, it defaults to Twitter.
- Only Twitter, Instagram, and Twitch are supported.
{{@|#|Trogday}}returns #Trogday{{@|#|Trogday|site=Instagram}}returns #Trogday
