Difference between revisions of "User:Telinchei/Test3 Templates"
(testing) |
m (→Time/Date parser: line breaks) |
||
(38 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{#ifexist: User:Telinchei | I know this guy and he's awesome | sadface :( }} | + | {{#ifexist: User:Telinchei | I know this guy, on this wiki he lives at {{{1}}} and he's awesome | sadface :( I cannot find {{{1}}} }} |
+ | |||
+ | __NOTOC__ | ||
+ | |||
+ | <!-- jeez, this is a sandbox, but oh well computers are dumb and must be told everything precisely... | ||
+ | wait, what? the toc templates... the tocright templates...--> | ||
+ | ==Template:Documentation and "#ifexist"== | ||
+ | This tells you what to look for: | ||
+ | [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23ifexist This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki.] | ||
+ | <nowiki>{{#ifexist: page title | value if exists | value if doesn't exist }}</nowiki> | ||
+ | |||
+ | While trying to sift through it and debug it, take note of the nesting template tags (esp. <nowiki>}}</nowiki>) | ||
+ | |||
+ | ===breaking stuff=== | ||
+ | |||
+ | {{#ifexist: User:Telinchei/Test3 Templates | ||
+ | | begin truebox. toc works too well.<!-- oops need to cross the linebreak... | ||
+ | -->{{<!--TRANSCLUDER BRACKETS ON LEFT! and a nesting ifeq follows; | ||
+ | -->{{#ifeq: {{NAMESPACE}} IT EXISTS | {{ns:Template}} NOEXISTS | | ||
+ | | ReturnT ANOTHERBOXANOTHERDAY :{{NAMESPACE:{{{1|{{FULLPAGENAME}}<!--param_switcher follows-->}}}<!-- | ||
+ | namespace close follows right-->}}:<!-- | ||
+ | -->abc wonder what this doesend }}<!-- why? turns out that guy was reverse engineering without making | ||
+ | documentation. ironic? | ||
+ | -->{{ #if: {{{1|}}} | BOX BOX {{PAGENAME:{{{1}}}<!--counting the brackets. Also, that was still visible. endif | ||
+ | -->}} | not-vis? BOX BOX BOX {{PAGENAME}}/doc}} }} END TRUEBOX | ||
+ | | returnF :<strong class="error">Nodoc!</strong> write@ [{{fullurl:{{{1|<!-- oh so this is when you should use it. | ||
+ | artificial line break, but when it's important to display. | ||
+ | -->{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} here]. More useless junk follows. | ||
+ | {{#ifeq:{{NAMESPACE}}|{{ns:10}}|There may also be documentation on [[w:c:templates:{{FULLPAGENAME}}/doc|Wikia <!-- | ||
+ | -->Templates]] which can be copied.}}[[Category:Templates without documentation]] | ||
+ | }} | ||
+ | <br/> <!-- put slash at end of br.--> | ||
+ | :Phew. You have finished the first tree. You should copy it cleanly somewhere for reference, before copying it into the main. Maybe that clean copy should go into the test at [[:Template:Documentation/test]]? Also, I don't have schizophrenia, I'm just talking to my future self, who is slightly separate from my current self. | ||
+ | |||
+ | {{#ifexist: <!--YOU MUST PUT A GOOD PARAMETER HERE {{{1| -->{{FULLPAGENAME}}/doc<!-- | ||
+ | }}}--> | ||
+ | | {{tocright}}{{ | ||
+ | {{#ifeq: {{NAMESPACE}} | {{ns:Template}} | | ||
+ | | :{{NAMESPACE:{{{1|{{FULLPAGENAME}}}}}<!--Namespace closescorrectly-->}}: | ||
+ | }}{{ #if: {{{1|}}} | {{PAGENAME:{{{1}}}}} | {{PAGENAME}}/doc}} }} | ||
+ | | returnF:<strong class="error">Nodoc!</strong> write@ [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} here]. {{#ifeq:A|A|dont care about this}} also sillytemplate | ||
+ | }} | ||
+ | |||
+ | ===makeitwork=== | ||
+ | This is the correct one. Parameter looks broken. | ||
+ | {{#ifexist: <!-- {{{1| -->{{FULLPAGENAME}}/doc<!-- | ||
+ | }}}--> | ||
+ | | {{tocright}}{{{{#ifeq: {{NAMESPACE}} | {{ns:Template}} | | ||
+ | | :{{NAMESPACE:{{{1|{{FULLPAGENAME}}}}}}}: | ||
+ | }}{{ #if: {{{1|}}} | {{PAGENAME:{{{1}}}}} | {{PAGENAME}}/doc}} }} | ||
+ | | :<strong class="error">Nodoc!</strong> write@ [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} here]. {{#ifeq:A|A|dont care about this}}[[Category:Templates without documentation]] | ||
+ | }} | ||
+ | |||
+ | {{#ifexist: User:Telinchei/Test3 Templates <!--Bx1--> | ||
+ | | <!--(bx2, toc)-->{{<!--nestingifeq -->{{#ifeq: {{NAMESPACE}} EXISTS(bx2) | {{ns:Template}} NOEXISTS(bx3) | | ||
+ | | ReturnT :{{NAMESPACE:{{{1|{{FULLPAGENAME}}}}}}}: | ||
+ | }}<!--end nesting ifeq | ||
+ | -->{{ #if: {{{1|}}} | BOX BOX {{PAGENAME:{{{1}}}<!-- -->}} | BOX BOX BOX {{PAGENAME}}/doc}} }} | ||
+ | | returnF :<strong class="error">Nodoc!</strong> write@ [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} here]. More useless junk follows.{{#ifeq:{{NAMESPACE}}|{{ns:10}}|There may also be documentation on [[w:c:templates:{{FULLPAGENAME}}/doc|Wikia Templates]] which can be copied.}}[[Category:Templates without documentation]] | ||
+ | }} | ||
+ | |||
+ | ==Incursion Discussion== | ||
+ | {{:Template:Discussion}} | ||
+ | Please discuss changes to the {{PAGENAME}} article on this page, indent your replies with the colon (:) and sign with the four tildes (~). If this change affects users other than UniWiki Editors, Forum and Slack discussion may be initiated and linked to or from this talk page as well, if necessary. | ||
+ | |||
+ | ==[[Template:Cleanup]]== | ||
+ | |||
+ | <includeonly>[[Category:Candidates for Cleanup]]</includeonly> | ||
+ | <div style="width: 80%; margin: 1em 10%; padding: 4px; background-color: #153E7E;"> | ||
+ | {| cellpadding="2" style="background-color: #153E7E; color: #FFFFFF; width: 100%; text-align:center;" | ||
+ | | '''This article should be cleaned up or improved.''' {{#if: {{{1|}}}|Reason: ''{{{1}}}''|A reason was not specified.}} | ||
+ | |} | ||
+ | </div> | ||
+ | |||
+ | ==Parameters== | ||
+ | [[User:Telinchei/Test3_Templates/Template:params]] | ||
+ | |||
+ | {{User:Telinchei/Test3_Templates/Template:params|five=somestuff|alpha=trolls}} | ||
+ | |||
+ | ==Time/Date parser== | ||
+ | {{#time: F Y}} <br/> | ||
+ | cf substitution: <nowiki>{{subst:#time: F Y}}</nowiki> = November 2015 <br/> | ||
+ | 18:02, 12 November 2015 (CST) (5 tilde) |
Latest revision as of 00:03, 13 November 2015
I know this guy, on this wiki he lives at {{{1}}} and he's awesome
Template:Documentation and "#ifexist"
This tells you what to look for: This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. {{#ifexist: page title | value if exists | value if doesn't exist }}
While trying to sift through it and debug it, take note of the nesting template tags (esp. }})
breaking stuff
begin truebox. toc works too well.Template:ReturnT ANOTHERBOXANOTHERDAY :User:abc wonder what this doesendnot-vis? BOX BOX BOX Telinchei/Test3 Templates/doc END TRUEBOX
- Phew. You have finished the first tree. You should copy it cleanly somewhere for reference, before copying it into the main. Maybe that clean copy should go into the test at Template:Documentation/test? Also, I don't have schizophrenia, I'm just talking to my future self, who is slightly separate from my current self.
if you see this the transcluder is working properly.
makeitwork
This is the correct one. Parameter looks broken.
if you see this the transcluder is working properly.
Template:ReturnT :User:BOX BOX BOX Telinchei/Test3 Templates/doc
Incursion Discussion
Template:Discussion Please discuss changes to the Telinchei/Test3 Templates article on this page, indent your replies with the colon (:) and sign with the four tildes (~). If this change affects users other than UniWiki Editors, Forum and Slack discussion may be initiated and linked to or from this talk page as well, if necessary.
Template:Cleanup
This article should be cleaned up or improved. A reason was not specified. |
Parameters
User:Telinchei/Test3_Templates/Template:params
Transcribe 1st, 2nd, or five=: 2
Transcribe 1st, or default to parameter 2nd: {{{2}}}
Time/Date parser
November 2024
cf substitution: {{subst:#time: F Y}} = November 2015
18:02, 12 November 2015 (CST) (5 tilde)