Template:Citation
I was browsing this site today and noticed an error in Template:Citation. This template displays "Help me, YourName" for registered editors, but for unregistered editors it displays "Help me, null". To fix this, I'd like to request that three edits be made:
- Please replace MediaWiki:Common.js with User:Mr. Stradivarius/common.js (diff). This stops MediaWiki:Common.js from inserting "null" if it can't find a username.
- Replace Template:USERNAME with User:Mr. Stradivarius/Template:USERNAME (diff). This adds a parameter to specify a default name for unregistered users.
- Replace Template:Citation with User:Mr. Stradivarius/Template:Citation (diff). This sets a default value of "Help me, Obi-Wan" for unregistered editors.
Please redirect or delete my sandbox pages after you've made the edits. I won't be needing them, and at the moment the category links in #2 and #3 are polluting template categories. Also, I'll be happy to discuss this if anyone wants to do things differently. Best -- Mr. Stradivarius (talk) 07:15, November 29, 2014 (UTC)
- Oh, but I always enjoyed the hypothethical "null." :D Yeah, seriously, though, it would be a good idea to change it. ProfessorTofty (talk) 21:53, November 29, 2014 (UTC)
- Cade Calrayn took care of part of this request this morning, and I finished it. Thanks; the "null" has always annoyed me too. —MJ— Holocomm 04:33, November 30, 2014 (UTC)
- Thanks to you and Cade Calrayn for taking care of this! I also noticed that I made a typo in the docs for Template:USERNAME: it currently reads
they see a default value of "<:insert name here>", but that should bethey see a default value of "<insert name here>", with a semi-colon instead of a colon. At the moment the "<:" is just coming out as plain text rather than as an HTML entity. Mr. Stradivarius (talk) 12:28, November 30, 2014 (UTC)- Fixed. I know enough about HTML that I should have caught that one. :P —MJ— Jedi Council Chambers 06:02, December 1, 2014 (UTC)
- Oh, and I just noticed your request to "Please redirect or delete my sandbox pages after you've made the edits." That is done as well. —MJ— Comlink 06:04, December 1, 2014 (UTC)
- Thanks to you and Cade Calrayn for taking care of this! I also noticed that I made a typo in the docs for Template:USERNAME: it currently reads
- Cade Calrayn took care of part of this request this morning, and I finished it. Thanks; the "null" has always annoyed me too. —MJ— Holocomm 04:33, November 30, 2014 (UTC)
Template:Eras
I've finished off coding Module:Eras, which is a replacement for Template:Eras. I did a quick test of the speed difference, and 100 transclusions of the module were rendered in about 3 seconds, compared to 22 seconds for the current template. That works out to about 0.2 seconds saved for every time {{eras}} appears on a page. Template:Eras is fully protected, so I can't edit it myself. Could an admin replace it with User:Mr. Stradivarius/Template:Eras (diff)? Also, you might want to keep an eye on Category:Pages with script errors when you do, and revert the change if you find it is causing a lot of errors. I couldn't find any problems in my tests, but you never know for certain what will happen until you make the switch. Mr. Stradivarius (talk) 11:21, December 3, 2014 (UTC)
- Done. However, it was dropping the namespace from the title on the actual Template:Eras page. I've added a quick fix in renderDisplayTitle(), though you might be able to clean it up or do something different. Also, it appears to not like lowercase parameters, so I tweaked that.. Cade
Calrayn 15:13, December 3, 2014 (UTC)
- Thanks for that. If the problem is just on the Template:Eras page, then we can just wrap the #invoke statement in includeonly tags to stop it from being parsed there. (That would render one of the category checks redundant as well, if I remember correctly.) If it's a problem on other pages too, though, then your code is probably the best solution. Mr. Stradivarius (talk) 16:06, December 3, 2014 (UTC)
- By the way, someone should protect Module:Eras - at the moment it's editable by anyone, and transcluded on tens of thousands of pages. — Mr. Stradivarius ♪ talk ♪ 03:54, December 14, 2014 (UTC)
- I seem to recall when clicking on the Legends or Canon banner that it would load up Star Wars Legends and Canon respectively. Now the banners are just direct links to the images. Should this be fixed to re-include the links or no? Fe Nite (talk) 21:34, December 15, 2014 (UTC)
- This should be fixed now. —MJ— Jedi Council Chambers 22:38, December 15, 2014 (UTC)
- I seem to recall when clicking on the Legends or Canon banner that it would load up Star Wars Legends and Canon respectively. Now the banners are just direct links to the images. Should this be fixed to re-include the links or no? Fe Nite (talk) 21:34, December 15, 2014 (UTC)
- By the way, someone should protect Module:Eras - at the moment it's editable by anyone, and transcluded on tens of thousands of pages. — Mr. Stradivarius ♪ talk ♪ 03:54, December 14, 2014 (UTC)
- Thanks for that. If the problem is just on the Template:Eras page, then we can just wrap the #invoke statement in includeonly tags to stop it from being parsed there. (That would render one of the category checks redundant as well, if I remember correctly.) If it's a problem on other pages too, though, then your code is probably the best solution. Mr. Stradivarius (talk) 16:06, December 3, 2014 (UTC)
Template:Quote
I've also converted Template:Quote to Module:Quote. If an admin could replace Template:Quote with the contents of User:Mr. Stradivarius/Template:Quote (diff), I would be very grateful. Mr. Stradivarius (talk) 11:42, December 3, 2014 (UTC)
Template:L
Any chance you could make a new version of {{Template:L}}? We were using this to make fast and easy canon links, for example, {{L|Luke Skywalker}} would get you [[Luke Skywalker/Canon|Luke Skywalker]]. But it was killed because apparently it really slowed things down. ProfessorTofty (talk) 12:20, December 3, 2014 (UTC)
- That's possible, but I'd be a bit wary of it, because it would increment the expensive parser function count for every page that was linked. Still, a Lua version ought to be a lot faster than a template-based version. Could someone email me the old template code so I can take a look at it? Mr. Stradivarius (talk) 13:32, December 3, 2014 (UTC)
- It was removed because it's impractical in the long run, and it was basically a template that promoted laziness. It's not going to be remade. Cade
Calrayn 14:22, December 3, 2014 (UTC)
- "Promoted laziness" is rather reductive reasoning. Having to type out [[Words word words/Canon|Words words words]] is a pain in the butt. If Mr. Stradivarius can speed up the template, why disallow it? If the impracticality is because of how /Canon pages may become the primary pages, and therefore Template:L will become obsolete, then IMO we should be having an actual site-wide conversation about making that change rather than continuing to kick the can down the road. - Brandon Rhea(talk) 15:59, December 3, 2014 (UTC)
- If performance is a real concern then we could make the template subst-only, so
{{subst:L|Luke Skywalker}}would produce[[Luke Skywalker/Canon|Luke Skywalker]], but{{L|Luke Skywalker}}would produce an error. But I won't know how expensive the code would actually be until I can get a look at the old template code. Mr. Stradivarius (talk) 16:18, December 3, 2014 (UTC)- We did that before with the last one, sort of. They started making everyone use "subst," but it didn't work out. The part about having an error if it wasn't used wasn't there though. ProfessorTofty (talk) 16:41, December 3, 2014 (UTC)
- I personally feel that there is potential for this template as a typing aid if and only if the template enforces subst-only. Strad, if you want to check it out and play around with it in a private sandbox, the code from the deleted version was simply
[[{{{1|}}}/Canon|{{{2|{{{1|}}}}}}]]. I don't think performance can be improved with Lua, but throwing an error if not substituted would be helpful. Per WP:AA, Cade will have to consent in order to restore some form of the template, though. —MJ— Jedi Council Chambers 07:01, December 4, 2014 (UTC)- Yep, for templates that simple, Lua won't help. It's only worth converting complex templates, as there is a slight overhead from calling the Lua code from PHP, and if a template only has a couple of parameters and no parser functions to speak of, the template will probably be quicker. I've created a subst-only version of Template:L at User:Mr. Stradivarius/Template:L, but it's just for demonstration purposes - I don't really care if it actually gets implemented or not. Mr. Stradivarius (talk) 11:38, December 4, 2014 (UTC)
- If performance is a real concern then we could make the template subst-only, so
- "Promoted laziness" is rather reductive reasoning. Having to type out [[Words word words/Canon|Words words words]] is a pain in the butt. If Mr. Stradivarius can speed up the template, why disallow it? If the impracticality is because of how /Canon pages may become the primary pages, and therefore Template:L will become obsolete, then IMO we should be having an actual site-wide conversation about making that change rather than continuing to kick the can down the road. - Brandon Rhea(talk) 15:59, December 3, 2014 (UTC)
- It was removed because it's impractical in the long run, and it was basically a template that promoted laziness. It's not going to be remade. Cade
Template:Facebook
I've converted Template:Facebook to Lua at Module:FacebookCite, and I think it's now ready to go live. There are test cases at Template:FacebookCite/testcases if anyone wants to check my work. (And feel free to add more test cases as well.) Could an admin update the template to the Lua-ised version? You can just copy and paste the code in Template:FacebookCite/sandbox. Mr. Stradivarius (talk) 15:51, December 7, 2014 (UTC)
- Looks good. However, before I go forward with it, I'd like to request one small tweak. Back in June, we decided (item 14) that going forward, all social media posts used as references must be accompanied by a screenshot. While it's not practical to throw an error without a screenshot, due to the large number of cited posts before that decision that don't have one, a tracking category would be useful to track template calls without a screenshot. Could that be implemented? —MJ— Comlink 18:32, December 7, 2014 (UTC)
- Ok, the module now adds pages to Category:Social media citations without screenshots if they are in the main namespace and they don't have a
|userpage=,|archive=or|image=parameter. Mr. Stradivarius (talk) 08:30, December 8, 2014 (UTC)
- Ok, the module now adds pages to Category:Social media citations without screenshots if they are in the main namespace and they don't have a
- Apologies for the delay. The Lua version is now live. Admins, if you see any major problems, feel free to revert this edit. —MJ— Jedi Council Chambers 18:52, December 10, 2014 (UTC)
- Thanks. :) — Mr. Stradivarius ♪ talk ♪ 03:54, December 14, 2014 (UTC)