Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G


Jump to: navigation, search

User:Skybike/Template:This months newsletter

4,391 bytes added, 12:15, 7 August 2018
changed parameters for link texts, changed default texts to newletters name, doku
<!-- #### Does the page specified by the user already exist? #### --> {{#if: {{{subpage-to|}}} |{{urlencode:{{{subpage-to|}}}|WIKI}}/}}<!--
# PAGENAME to test#
| en = FlightGear_Newsletter_{{#time: F Y |{{{date|now}}} | en }}
##### Yes, there is such a page. Link to it. #####--> |{{{alttext1|}}} <!--attext1 empty by default, alternative sth. like "Please help us write" (plain black text) -->[[#if:{{#iftitleparts: {{{subpage-tolink|}}} |1|2}}|{{urlencode#titleparts:{{{subpage-tolink|}}}|WIKI1|1}}/&#32;}}<!--text1/linktext/text2: if more than 1 part? print text1 black
-->[[{{#if: {{{subpage-to|}}}|{{urlencode:{{{subpage-to|}}}|WIKI}}/}}<!--  # pagename to link to: # -->{{LangSwitch|lang={{{lang|}}}
| en = FlightGear_Newsletter_{{#time: F Y |{{{date|now}}} | en }}
| de = De/FlightGear_Newsletter_{{#time: F Y |{{{date|now}}} | de }}
##blue link text:## #linktext defaults to the newsletters name if "link=" not used or called "name" or "/name"# -->|{{#ifexpr: {linktext1{#if:{{{link|}}}|0|1}} or {{#ifeq:{{{link|}}}|name|1|0}} or {{#ifeq:{{#titleparts:{{{link|}}}|1|2}}|name|1|0}}<!-- -->|{{LangSwitch|lang={{{lang|}}}<!--linktext1 defaults "This months link text gets shown if the newsletterexists--> | en = FlightGear Newsletter {{#time: F Y |{{{date|now}}} | en }} | de = FlightGear Newsletter {{#time: F Y |{{{date|now}}} | de }} }}<!-- #if called "read name" or alternative "the coming edition!/read name"# -->|{{#ifexpr:{{#ifeq:{{{link|}}}|read name|1|0}} or {{#ifeq:{{#titleparts:{{{link|}}}|1|2}}|read name|1|0}} |{{LangSwitch|lang={{{lang|}}} | en = This months newsletterread the FlightGear Newsletter {{#time: F Y |{{{date|now}}} | en }} | de = FlightGear Newsletter für diesen Monat{{#time: F Y |{{{date|now}}} | de }} lesen }}<!-- #custom text given as "link=linktext" or "link=text/linktext"# -->|{{#if:{{#titleparts:{{{link|}}}|1|2}} | {{#titleparts:{{{link|}}}|1|2}} | {{#titleparts:{{{link|}}}|1|1}} }}}}}}]]<!--
--> {{#titleparts:{{{link|}}}|1|3}}<!-- last "text/link/text" text
##### No, there is no such page. Preload subpage and create it. #####
## if create=a/b/c has more than 1 part, print first part in black ##
## No, there is no such page. Preload subpage and create it. ##
-->|{{{alttext2|}}}<!-- alttext2 is empty by default (black text)
--><span class="plainlinks"><!--No http-link Icon
-->{{#if: {{{subpage-to|}}} |{{urlencode:{{{subpage-to|}}}|WIKI}}/}}<!--
# Name of the created page #
| en = FlightGear_Newsletter_{{#time: F_Y |{{{date|now}}} | en }}
#Draft to preload to the above page#
-->&preloadparams%5b%5d={{#time: Y |{{{date|now}}}}}<!-- $2 is Year (like 2019)
-->&preloadparams%5b%5d={{urlencode:{{current release|cr}}}}<!-- $3 is current release
-->&summary=Created_preloaded_pageCreated%20preloaded%20page<!-- A short summary(%20 is hex ASCII for space)
## blue linktext, shown as default if empty or "create=create name" or "create=/create name" ## --> {{#ifexpr: {linktext2{#if:{{{create|}}}|0|1}} or {{#ifeq:{{{create|}}}|create name|1|0}} or {{#ifeq:{{#titleparts:{{{create|}}}|1|2}}|create name|1|0}}<!--linktext2 is "Create this months newsletter"
| en = Create this months newsletter FlightGear Newsletter {{#time: F Y |{{{date|now}}} | en }} | de = Den FlightGear Newsletter für diesen Monat {{#time: F Y |{{{date|now}}} | de }} erstellen }}<!-- # shown as newsletter name if create=name or create=/name" # -->|{{#ifexpr:{{#ifeq:{{{create|}}}|name|1|0}} or {{#ifeq:{{#titleparts:{{{create|}}}|1|2}}|name|1|0}}|{{LangSwitch|lang={{{lang|}}} | en = FlightGear Newsletter {{#time: F Y |{{{date|now}}} | en }} | de = FlightGear Newsletter {{#time: F Y |{{{date|now}}} | de }} }}<!-- # custom blue link text as "create=abc" or "create=/abc" # -->|{{#if:{{#titleparts:{{{create|}}}|1|2}} | {{#titleparts:{{{create|}}}|1|2}} | {{#titleparts:{{{create|}}}|1|1}} }}}}}}]</span class><!-- ## last black "text/link/text" text ## --> {{#titleparts:{{{create|}}}|1|3}}<!-- -->}}<noinclude>
{{Informative template|1=
This sandbox experiment is based on [[User:Johan G/Template:This months newsletter]].
If we decide to publish it I would suggest a more general name like "Template:Newsletter link" instead of "This months newsletter" as you can change the date here.
== Goal ==
This template will link to the current [[FlightGear Newsletter]]. If it does not yet exist this template will show a red link that when clicked will load a FlightGear Newsletter example with common headings, templates and categories already there, as well as some helpful comments for the editor.It is multilingual and supports custom
== Usage ==
{{obr}}<small>:User:Skybike/Template:</small>'''This months newsletter''' {{!}}''date='' {{!}}''alttext1link='' {{!}}''linktext1='' {{!}} ''alttext2='' {{!}}''linktext2create='' {{!}}''subpage-to='' {{!}}''lang='' {{cbr}}
'''All parameters are optional'''
; date: Default is ''current date''. But you can choose a different date in the form '''YYYY-MM''' (like {{CURRENTYEAR}}-{{CURRENTMONTH}}).
;linktext1link, linktext2create: Alternative name for the blue printed link to an existing Newsletter ("linktext1", by default "[[Next newsletter|This months newsletter]]") and to not existing Newsletter (by default "linktext2FlightGear Newsletter {{#time:F Y|now}}", defaults to and "[[Next newsletterCreate FlightGear Newsletter {{#time:F Y|Create this months newsletter]]now}}")
===Advanced Usage===
'''All parameters are optional''';alttext1date=*Default is <tt>now</tt>. More expressions are <tt>2019-6, alttext2: Explanatory black text followed by the January 2020, next month, last month, +1 month, +8 month, +8 months, -8 days,</tt>,...*Only english therms are accepted, <tt>März 2018</tt> or <tt>nächster Monat</tt> do NOT work, nowhere.<br>;link= / create=* Shown as blue link. It text linking to an existing newsletter (link=) and creating a new one (create=):** "<tt>link=abc{{!}}create=def</tt>" shows up as "alttext1 [[Next newsletterMain Page|linktext1Abc]]" and both of them or "[[Main Page|Def]]"<br>* There are optional explanatory black texts around the blue link. Both are empty by default. You will find can define them by a "/" slash in the way "<codett>alttext1 link= Help us write black/blue/black</tt>" "Black [[Main Page|blue]] black"** Only the first one: "<tt>Write/me</tt>" shows "Write [[Main Page|me]]"** Both texts: "<tt>Write/me/now</tt>" shows "Write [[Main Page|me]] now"** Only the last text: "<tt>/me/now</tt>" shows "[[Main Page|Me]] now"** No text: "<tt>Me</tt>" shows "[[Main Page|Me]]"<br>* There are magical words supported (only) by the blue link:** "<tt>name</tt>" as well as "<tt>/name/</tt>": [[Main Page|FlightGear Newsletter {{!#time:F Y|now}} linktext1 ]] (which is the default for "link")** "<tt>read name</tt>": "[[Main Page|Read FlightGear Newsletter {{#time:F Y|now}}]]" (only for "link= ")** "<tt>create name</tt>": "[[Next newsletterMain Page|Create FlightGear Newsletter {{#time:F Y|now}}]]" (only for "create=". Is the default there as well)** type the newsletters name manually for more combinations: <code><nowiki>FlightGear Newsletter {{#time:F Y|now}}</nowiki></code> at quite some places around this wiki. <br>
; subpage-to: Create the next newsletter as a subpage to ''subpage-to'' instead of as a separate page. Can be used for sandbox experiments as a subpage to your user page.
<!--: Using this option no categories will be included.-->
In {{tl|newsletter-header}} we would use <codett>alttextlink= </tt> and linktext<tt>create=</codett> to replace the default text: {{obr}}'''This months newsletter'''{{!}}alttext1link=''Please help us write''{{!}}linktext1=''/the coming edition!''{{!}}linktext2create=''Create the coming Newsletter edition''{{cbr}}{{:User:Skybike/Template:This months newsletter|alttext1link=Please help us write|linktext1=/the coming edition!|linktext2create=Create the coming Newsletter edition}}
On translated pages (like De/Newsletter) you can link to last months english newsletter via:
{{obr}}'''This months newsletter''' {{!}}''date=last month'' {{!}}''lang= en'' {{!}}''alttext1link=Add your article to theenglish/name'' {{!}}''linktext2=English newsletter'' {{!}}''linktext2ceate=Create English newsletter''{{cbr}}
{{:User:Skybike/Template:This months newsletter|date=last month|lang=en|alttext1link=Add your article to theenglish/name|linktext1=English newsletter|linktext2create=Create English newsletter}}
<!--== Known issues ==*The first letter of "create=" and "link=" is always a capital letter*<tt>text//text</tt> and <tt>text/</tt> does not work as you need a link text. Use <tt>text/name/text</tt> instead (or don't use link= and create= at all).*You can't combine the magical word "name" with other words than "create" and "read" within the blue link ("create=ab/cd name ef/gh" or "link=ab name" does not work). Type the newsletters name manually or define these words as black text using "/" slash*time= only works with english language, try to use international "YYYY-MM" (2018-12) whenever possible to help translators.*"name" and "read name" and "create name" are english codewords but have translated output. <tt>{{!}}create=bitte/''create name''/, um ihn zu füllen{{!}}lang=de</tt>*The internal wiki server may need some time (up to minutes) to index new pages. This template still shows the "create" link during that time.<!--While it is stated that "Using this option the normal categories will not be included." they currently in fact are.
:If there should be a need for this, just add a Preloadparam $4 that ships ":Category:" or "Category:" (without first colon) in it, based on if subpage-to= is used or not. But this would make the draft template harder to understand.-->

Navigation menu