Jump to content

Template talk:Canadian election result

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

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]

seeking guidance

[edit]

Can someone explain why Template:2017 Vancouver municipal by-election/City Council had to be moved to Template:2017 Vancouver municipal by-elections/City Council (with the s tacked on to "by-election") to work properly when transcluded into 2017 Vancouver municipal by-election?

When the template was at Template:2017 Vancouver municipal by-election/City Council and was transcluded using:

{{2017 Vancouver municipal by-election/City Council}}

it failed to generate the v/t/e links in the table. Using the plural "by-electionS" seems to have fixed the issue but I'd love to know why since the article title does not have the s. —Joeyconnick (talk) 05:23, 17 March 2025 (UTC)[reply]

The /top template code has this code to build the navbar:
{{#ifeq:{{{by}}}|yes|by-|}}election{{#ifeq:{{{by}}}|yes|s|}}}}
Don't ask me why. – Jonesey95 (talk) 13:40, 19 March 2025 (UTC)[reply]
Thanks for your response! I'm not a template editor... any chance we can fix this? Basically every time this template is transcluded, it should always generate v/t/e links. There's no case where those should ever fail to be present.
The same problem is present 4 times in 2018 Vancouver municipal election, as well. —Joeyconnick (talk) 02:58, 27 March 2025 (UTC)[reply]