Template talk:User edits to Wikipedia

Latest comment: 2 years ago by CJDOS in topic Edit to userbox code
WikiProject iconUserboxes
WikiProject iconTemplate:User edits to Wikipedia is part of WikiProject Userboxes. This means that the WikiProject has identified it as part of the userboxes system. WikiProject Userboxes itself is an attempt to improve, grow, and standardize Wikipedia's articles and templates related to the userbox system, used on many users' pages. We need all your help, so join in today!

Created talk-page

edit

Created talk-page for {{Wikipedianumedits}} - Enjoy! :) Drbogdan (talk) 22:51, 18 September 2017 (UTC)Reply

Edit to userbox code

edit

With permission, I would like to change this template's coding. The edit I wish to perform is to replace the word edits with [[Special:Contributions/{{ROOTPAGENAME}}|edits]]. When the template is placed on a user's page, the word "edits" will be linked to that user's Special:Contributions page. Actually, I would like to see the link activated by a parameter switch, such as |link=yes as an optional parameter that a user can add to the template so that they can choose whether they want it to link to their Special contributions page or not... but I don't know how to do that yet.

It took a bit of trial and error, but I think I got the optional activation switch working as described above. The number of edits is the first parameter. If the second parameter is "link", it links to user's Contribution page, otherwise plain text it the default:

{{Userbox
| id     = [[File:Wikipedia-logo-v2.svg|43px]]
| info   = This user has made over<br />'''{{{1}}}''' {{#switch:{{{2}}}|link=[[Special:Contributions/{{ROOTPAGENAME}}|edits]]|edits}} to [[Wikipedia]].
| info-a = center
}}<noinclude><!--[[Category:Wikipedia editing-related user templates|User edits to Wikipedia]]--></noinclude>

The hidden text markup would be removed from the category when implemented, of course. — CJDOS, Sheridan, OR (talk) 09:31, 11 July 2021 (UTC) (appended 11:21, 11 July 2021 (UTC), edited 12:12, 11 July 2021 (UTC))Reply

  Implemented: With no reply in nearly 2 months, I will proceed with an edit, except rather than using [[Special:Contributions/{{ROOTPAGENAME}}|edits]] as the edit link, I will use [[xtools:sc/en.wikipedia.org/{{ROOTPAGENAME}}|edits]] which is similarly used for {{Service award progress}}. — CJDOS, Sheridan, OR (talk) 06:27, 8 September 2021 (UTC)Reply

It occurred to me that some usernames may not pass well, so I've added the magic word urlencode: {{urlencode:{{ROOTPAGENAME}}|WIKI}} — CJDOS, Sheridan, OR (talk) 08:41, 8 September 2021 (UTC)Reply