Jump to content

Template talk:Canadian election result

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Attempt to edit /top

[edit]

@Wbm1058: Do you remember which pages had errors from my edit of Template:Canadian election result/top? My sandbox test cases all looked fine, so I don't know in what situations the code breaks. —Arctic Gnome (talkcontribs) 15:33, 23 October 2023 (UTC)[reply]

Look at Template:Canadian election result/top/sandbox. There are two issues to note there.
1) Joeyconnick has repeatedly tried to tell you that we do not use curly quotes per MOS:CURLY (diff) – do you have a problem with that?
2) The header says "[[Error Invalid general election]]:" while the live version which I reverted to Template:Canadian election result/top does not. What caused that change? Does your new version introduce some form of error checking that the previous version did not have? wbm1058 (talk) 15:50, 23 October 2023 (UTC)[reply]
1) The 'find' command shows all quotes whether I put normal quotes or curly ones into the search bar. How do you detect these curly quotes? Is the easiest solution to retype all quotes in the template before publishing?
2) All of my test cases looked fine, so I assumed that error was a result of the template not having inputs, and it would be fine in the finished product. Should I fix that by giving the template a placeholder value to use when there is no input? —Arctic Gnome (talkcontribs) 14:53, 24 October 2023 (UTC)[reply]
re: 1) OK, I see that the curly quotes were apparently first added to the template by Who R you? back in 2014, and you've been trying to make changes to older versions where the curly quotes had not been replaced with straight quotes. I just used the JavaScript Wiki Browser to do that. That tool has a bit of a learning curve, so I'm willing to help by making that edit again as needed in the sandbox, just for the asking. I also noted the need to replace the ellipsis () with 3 periods. – wbm1058 (talk) 01:01, 25 October 2023 (UTC)[reply]
re: 2) One of my patrols is for pages transcluding {{error}}s in main namespace and a lot of Canadian election-related pages were turning up on that list, which is what brought me here. When a page lands on that list, I expect to see an obvious, big, red, error message stating the problem and giving instructions on how to fix the reported problem. Although I saw one or two pages showing me an error similar to what the sandbox template shows, most did not show obvious errors. The template should be coded to ensure that it doesn't report "false-positive errors", which can be a bit tricky to do. I was trying to find where this error message was coming from and I don't think I'd tracked it down yet. When I reverted you on July 8, I was hoping that you would figure it out, but, I guess I need to do more since we're still stuck here. – wbm1058 (talk) 01:20, 25 October 2023 (UTC)[reply]
Thanks, I'll try again when I have some free time. I've been trying to minimize the size of the template, but there might be too many moving parts. —Arctic Gnome (talkcontribs) 18:21, 25 October 2023 (UTC)[reply]

Template-protected edit request on 27 October 2024

[edit]

Would it be possible to edit the {{Canadian election result/top}} template so that they are sorted alphabetically by riding name in their respective YEAR CATEGORY FOR GENERAL ELECTIONS (e.g. in Category:2021 Canadian federal election results by riding). As of right now, they seem to be categorized without a Sort key (e.g. [[Category:"Year" "Jusrisidiction" election results by riding]] instead of [[Category:"Year" "Jusrisidiction" election results by riding|"Riding name"]]), which is not very helpful for navigation within categories for a specific general election. From what I understand, the edit would look something like this:

<!-- YEAR CATEGORY FOR GENERAL ELECTIONS -->|{{category handler|template=[[Category:{{{election|{{{2}}}}}} {{#switch:{{{jurisdiction|{{{1}}}}}}|CA=Canadian federal|AB=Alberta general|BC=British Columbia general|MB=Manitoba general|NB=New Brunswick general|NF=Newfoundland general|NL=Newfoundland and Labrador general|NS=Nova Scotia general|NT=Northwest Territories general|N-W=North-West Territories general|NU=Nunavut general|ON=Ontario general|PE=Prince Edward Island general|QC=Quebec general|SK=Saskatchewan general|YK|YT=Yukon general|MTL=Montreal municipal|OTT=Ottawa municipal|TOR=Toronto municipal|VAN=Vancouver municipal|}} election results by riding|{{{riding|{{{3}}}}}}]]|nocat={{{nocat|}}}}}}}<!--

RedBlueGreen93 21:59, 27 October 2024 (UTC)[reply]

 Done * Pppery * it has begun... 02:33, 4 November 2024 (UTC)[reply]

Protected edit request on 15 January 2025

[edit]

The "by riding" categories were renamed per Wikipedia:Categories_for_discussion/Log/2025_January_6#Category:Canadian_federal_parliamentary_election_results_by_riding, and this will need to be changed in the template. –LaundryPizza03 (d) 02:39, 15 January 2025 (UTC)[reply]

LaundryPizza03: I don't see relevant code in this template, but I didn't look any deeper. Please give an example of an affected page, and I will track down the change that is needed. Also, it appears that not all of the needed categories have been created yet; see Category:1929 Ontario general election results by riding templates. – Jonesey95 (talk) 17:26, 16 January 2025 (UTC)[reply]
It appears that Bearcat made a change that fixed the federal categories but resulted in a bunch of red-linked categories. I wonder if Bearcat will post at VPT yet again about people making changes to templates that mess up categorization. :) – Jonesey95 (talk) 17:31, 16 January 2025 (UTC)[reply]
The problem was that the federal election categories got moved by CFD discussion, but because of the above issue none of the content actually moved to the new categories and the old ones showed up as non-empty redlinks at WantedCategories — and because the category handler doesn't differentiate federal from provincial elections at all, there was no way to fix the redlinks without either reverting all the moves or breaking provincial categories at the same time. So I'm currently dealing with the provincial/territorial categories, having resolved most of the ones I'm aware of and working through Ontario as we speak — Ontario required a double-step, further, because the old category was also being transcluded by a separate Ontario template documentation page so that the update resulted in pages being included in both the updated category and the old one alongside each other.
To the best of my knowledge, once I'm done Ontario there won't be anything left in Category:Canada provincial election results by riding templates that's unresolved — I'll then have to deal with a handful of Montreal municipal election results, but as far as I know the job will then be complete. I'll post here to update when I'm done. Bearcat (talk) 17:40, 16 January 2025 (UTC)[reply]
Update: I've got every subcategory under Category:Canada election results by riding templates that didn't have the word "templates" in it moved. That should take care of all the redlinks, though please let me know if you do come across any other stragglers that were caused by this without being detected and fixed.
Also, I've asked about this before without any resolution, so I need to ask again: can we please find a way for this template's category handler to segregate municipal elections from federal, provincial and territorial elections? The problem is that municipal elections are not conducted "by riding", but because this template fails to account for that we're stuck with a whole bunch of nonsense "YYYY Montreal municipal election results by riding templates" categories that we can't get "by riding" out of because the template automatically imposes it. (Montreal is the only city with this problem, as other cities aren't using this template to format their election results templates — if other cities were using this template, they would have this problem as well.) So can we please figure out a way to knock "by riding" out of the category name in municipal elections since it doesn't belong there? Bearcat (talk) 18:09, 16 January 2025 (UTC)[reply]
I have made a change to {{Canadian election result/top/sandbox}} that tries to display "by riding" only for non-municipal election categories. I have not tested it at all, but it might work. – Jonesey95 (talk) 18:37, 16 January 2025 (UTC)[reply]
Okay, thanks. I'm willing to try implementing that in the main template to test if it works, though obviously I'll revert myself right away if it doesn't. Stay tuned! Bearcat (talk) 18:52, 16 January 2025 (UTC)[reply]
Looks like a success! It got "by riding" out of the Montreal categories, which I'll now fix, and doesn't appear to have broken any of the provincial or federal categories that I've checked. Thanks again! Bearcat (talk) 18:59, 16 January 2025 (UTC)[reply]
Nice. LaundryPizza03, I am marking this request as "answered". If there is more to be done, let us know here. – Jonesey95 (talk) 20:41, 16 January 2025 (UTC)[reply]

Edit request: NDP

[edit]


Please edit to redirect "NDP" to New Democratic Party of Quebec (2014) (for elections on or after 2014) because "NDP" meaning New Democratic Party of Quebec is ambiguous. Shhhnotsoloud (talk) 23:01, 16 January 2025 (UTC))[reply]

Actually I now realise the situation is not as straightforward as this. The field corresponding to "NDP" needs to redirect to whichever of the ambiguous uses of "NDP" is appropriate among those listed at New Democratic Party of Quebec. Shhhnotsoloud (talk) 13:59, 17 January 2025 (UTC)[reply]
 Not done: it's not clear what changes you want to be made. Please mention the specific changes in a "change X to Y" format and provide a reliable source if appropriate. And explain which template page(s) should be modified. – Jonesey95 (talk) 14:57, 17 January 2025 (UTC)[reply]
@Jonesey95: Thank you for offering to sort this out. The problem that I am trying to solve is an excessive amount of incoming redirects to New Democratic Party of Quebec: see [1]. They appear to be generated by templates in the Template:Canadian election result series. As you can see New Democratic Party of Quebec is now a disambiguation page because "New Democratic Party of Quebec" is ambiguous. Shhhnotsoloud (talk) 16:18, 17 January 2025 (UTC)[reply]
Because you reverted an edit to make it a disambiguation page again. The Banner talk 04:59, 18 January 2025 (UTC)[reply]
It looks like Graham11 started this mess by moving the original page and making a disambiguation page in its place. That editor or others supporting the page move should be willing to clean up the now-broken incoming links. – Jonesey95 (talk) 06:42, 18 January 2025 (UTC)[reply]
Or we can revert those changes and restore the original situation. The Banner talk 13:28, 18 January 2025 (UTC)[reply]
Those links are coming from {{Canadian party colour/name}}, where the code QC|NDP generates a link to New Democratic Party of Quebec, and appears to have done so for a long time. I don't know why this issue would be coming up now, when it appears to have been a problem for a while; maybe nobody noticed until now. Earl Andrew appears to do a lot of maintenance of that template; maybe that editor has an idea about how to distinguish these two identically named parties in articles. If I were fixing it, I would probably make two new abbreviations and have "NDP" generate an error, since it is ambiguous. – Jonesey95 (talk) 16:49, 17 January 2025 (UTC)[reply]
Hello, I've added two new codes, NDP (1963) and NDP (2014). I'm not changing the default NDP code to an error though, as I don't feel like fixing all of the templates.-- Earl Andrew - talk 17:12, 17 January 2025 (UTC)[reply]

 Done Templates fixed – with thanks to @Jonesey95: and @Earl Andrew:. Shhhnotsoloud (talk) 15:12, 18 January 2025 (UTC)[reply]

The overall problem is not fixed. There are still a ton of incoming links to the disambiguation page. – Jonesey95 (talk) 15:14, 18 January 2025 (UTC)[reply]
Hey all, sorry I haven't had a chance to correct those links! I noticed many of the links to New Democratic Party of Quebec from before the page move – when the page title was for the article about the party established in 2014 – actually intended to refer to the party established in 1963, so the process isn't as straightforward as simply changing all the existing links to New Democratic Party of Quebec (2014). I can take a crack at some of them today. Graham (talk) 18:51, 18 January 2025 (UTC)[reply]
Yes, that's what I've been finding as well. I've corrected a couple of templates and a few other articles. So far I've found the link in tables so the usual quick method of dablinking hasn't been working. I've had to go into the tables and add the "(1963)" to the NDP in the {{CANelec}} templates (thank you very much, editor Earl Andrew). And thank you so much, editor Graham11, for all your help! P.I. Ellsworth , ed. put'er there 19:22, 18 January 2025 (UTC)[reply]