Template talk:W-all
This template is in the collection of greetings templates maintained by the Welcoming Committee. For other templates in the collection, see Welcome templates. |
Why this code?
[edit]Hi, I took a look in the code of your template, and I noticed that you had written
su<includeonly></includeonly>bst:
.
Why that, does it have any specific purpose? If you wrote it like that because you noticed that you got problems when you wrote <includeonly>subst:</includeonly>
, maybe it is because subst
and includeonly
don't go very well together by some reason (I don't really know why but you can read more about it here). In that case, the solution can be to use
<includeonly>safesubst:</includeonly>
instead. —Kri (talk) 23:53, 1 July 2011 (UTC)
- Hmm, offhand I don't understand that edit; there shouldn't be anything magical about where you place the
<includeonly>...</includeonly>
tags, and readibility is an issue with code.currentuser
isn't mentioned in Help:Variable, justrevisionuser
. Alias, perhaps? - As for safesubst:... that may come in handy if the template is accidentally transcluded. Otherwise the newbie would see lots and lots of code... But I can test that out on the User talk:Sandbox for user warnings page.
- Done This page is littered with code in need of subst-checking. For handy links for interested parties:
- Meteor_sandwich_yum (talk) 00:28, 24 April 2014 (UTC)
- For my own thought process, I removed the substitution of parser functions, and substituted current copies of the page onto User talk:Sandbox for user warnings.
- I was trying to decide upon a method to reduce code clutter, in case someone forgets to substitute the template when placing it on a user page: the system doesn't understand how to process it and we see "the guts" of the code, something that could be overwhelmingly complex to a new user (for example, see the "control" case for a workup of code that will remain on the talk page). Note that it only appears in the editing window, as the code doesn't render on the talk page.
- Below are three different scenarios: without substitution ("control", very messy); with substitution (how it was before I arrived); and with safe-substitution and a single <noinclude/> tag (where the code is now).
- Going from without substitution to with, this is what changes.
- In this scenario the code doesn't clutter up the editing window; only a few parser functions I missed remain.
- Going from with to with safe-substitution/noinclude this is what changes.
- Again, looks pretty clean, but uses shorter code that I
stoleborrowed from Template:Welcome.
- Again, looks pretty clean, but uses shorter code that I
- In essence,
<includeonly>subst:</includeonly>#parserfunction
has now becomesafesubst:<noinclude/>#parserfunction
. Pretty much just safesubst: now. Meteor_sandwich_yum (talk) 02:53, 24 April 2014 (UTC)
Grammar fix
[edit]May I suggest a grammatical fix? The sentence "Thank you for your contributions to Wikipedia, it has helped make Wikipedia a better encyclopedia" is a comma splice. --Jprg1966 (talk) 16:32, 4 December 2013 (UTC)
- Wow. I love Wikipedia (I can't see any other website paying any attention to grammar).
- Still figuring out how to re-phrase it. Meteor_sandwich_yum (talk) 23:53, 23 April 2014 (UTC)
- I ended up re-wording it so it wouldn't sound as clunky: "Thank you for your contributions to Wikipedia, users like you are what makes Wikipedia such a great encyclopedia!" It sounds more natural even if it's not entirely grammatically correct; I don't think more than half our users would notice a difference with a semicolon. Or is the latter clause now suitable because I made it a dependent clause? Ehh... still sounds slightly off-tone, so (anybody) feel free to tweak it if you come up with a better greeting. Let's hope that our enthusiasm will make up for our poor grammar. Meteor_sandwich_yum (talk) 07:09, 24 April 2014 (UTC)
Needlessly complex
[edit]I enjoy programming, and can comprehend 90% of what the source code says without looking any of it up. However, to borrow from Unix thought here: the more complex this code is, the more error-prone it will become, and the tougher it will be to edit the page (to figure out where to insert a new link, for example).
I notice repetition, and I'm thinking it should be possible to create a subpage to store the repetitious code and just transclude the code a few times. That would cut down on the number of lines and increase readability.
Let's make this so anybody can edit this page. Anyway, not up for coding that tonight. Meteor_sandwich_yum (talk) 05:05, 16 April 2014 (UTC)
- Hmm, I printed it out. Six pages. I noticed several minor errors and unnamed parameters that can be safely discarded.
- Not here to hate or judge; this is a very flexible template, it's just hard to maintain and a bit advanced. About to work on it. Meteor_sandwich_yum (talk) 03:42, 23 April 2014 (UTC)
- Summary of changes:
- Removed unnamed parameters 1—4 (to cut down on the bulk of code).
- Removed parameter value
none
from parametertext
; a word-for-word copy of the parameter default (I guess in case you feel the need to specify "nothing special" for some reason?).- To whom it may concern, the switch function automatically considers the last parameter to be "default", but if you really want to label it in the source code, it can be explicitly called using
|#default=
. Another option is to label a "case value"|default
or|none
above the last case value to group the results (note that I dropped the equals sign). More info: mw:Help:Extension:ParserFunctions#Grouping results
- To whom it may concern, the switch function automatically considers the last parameter to be "default", but if you really want to label it in the source code, it can be explicitly called using
- Removed mention of the skin "short" within the doc subpage—no longer exists
- Fixed Changed code from
<includeonly>subst:#parserfunction</includeonly>
tosafesubst:<noinclude/>#parserfunction
. The<includeonly>...</includeonly>
/<noinclude>...</noinclude>
tags are roughly equal, so the only real change was "subst:" to "safesubst:" - Fixed went through & optimized code, renamed parameters with odd names & copyedited template and the documentation
- Fixed broken IRC link. Original was http(s)://toolserver.org/~bjelleklang/pjirc/, which expired (archived version); replaced with https://webchat.freenode.net/?channels=wikipedia-en-help
- Added uppercase/lowercase alias parameters for {{{irc}}} and {{{NPOV}}} (IRC and npov work)
- Added labels wrapped in
<noinclude>...</noinclude>
tags to signify the beginning of a skin (invisible HTML comments).
- In the end I decided not to divide it up into several subpages (e.g., one for each skin) but just reduce the size of the code and label it. Here's the total diff: [1]
- So yeah, good luck with the template! Hope I helped. Meteor_sandwich_yum (talk) 06:51, 25 April 2014 (UTC)
- Fixed Found specialized template (should be more intuitive): rather than comparing uppercase/lowercase usernames to check if it's an IP or not, used the template IsIPAddress to check. Should make for clearer code. Meteor_sandwich_yum (talk) 01:03, 5 May 2014 (UTC)
Proposed change
[edit]The template currently reads:
- I'm (Username), one of the thousands of editors here at Wikipedia.
I propose to change "thousands" to "millions" as Special:Statistics says Wikipedia has over 36,000,000 users. - ZLEA T\C 17:21, 6 May 2019 (UTC)