Template talk:Election results
![]() | This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
|
|
||
This page has archives. Sections older than 180 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Is this an error with the template or my formatting?
[edit]I'm trying to make an election chart but I'm running into an issue, and I'm not sure if it's my formatting or the template:
The following is the formatting I'm using
{{Election results
|alliance1=1st Party|seats1=148
|alliance2=Alliance|aspan2=3|party2=Alliance - 2nd Party|seats2=69
|party3=Alliance - 3rd Party|seats3=26
|aseats4=97
|party5=4th party|seats5=53
}}
the intent is that the 2nd and 3rd party are both present in the alliance, with the total of that alliance listed too (hense |aseats4=97), but it seems like it won't come up on the actual template and instead produces this issue:
Party or alliance | Seats | |||
---|---|---|---|---|
1st Party | 148 | |||
Alliance | Alliance - 2nd Party | 69 | ||
Alliance - 3rd Party | 26 | |||
4th party | 53 | |||
Total | 296 |
If this is an issue with my formatting, I'd love to know what I've done wrong. If it's an issue with the template, I'd appriciate it if the template could be altered to not produce this issue Bejakyo (talk) 23:56, 12 March 2025 (UTC)
- ironically the issue resolves itself but only if I remove the aseats4 and change the alliance size from 3 to 2 (which while it correctly displays 4th party as outside of the alliance, it still leaves the issue of not seeing the total of seats in an alliance) Bejakyo (talk) 00:03, 13 March 2025 (UTC)
- It's because you are missing out the atotalnv4=y (alliance total, no votes). Below is what it looks like if you add that. Number 57 01:16, 14 March 2025 (UTC)
- bril, thank you very much for the help Bejakyo (talk) 06:08, 14 March 2025 (UTC)
- It's because you are missing out the atotalnv4=y (alliance total, no votes). Below is what it looks like if you add that. Number 57 01:16, 14 March 2025 (UTC)
Party or alliance | Seats | |||
---|---|---|---|---|
1st Party | 148 | |||
Alliance | Alliance - 2nd Party | 69 | ||
Alliance - 3rd Party | 26 | |||
Total | 97 | |||
4th party | 53 | |||
Total | 296 |
Added rowscopes; one case still missing
[edit]I went through and worked out how to get rowscopes into the top-half rows (per WP:DTAB). The bottom rows already had them (probably since there's not as much logic around them). It's a gnarly little template but I think I got it all sorted with the extensive testcases. There is one case that's still missing that I don't know enough lua to figure out: if you have alliances+parties (no candidates), but not all parties are in alliances (such as Template:Election results/testcases#Alliance totals), then the alliances have rowscopes but the un-allied parties don't. It's basically because the determination to put a rowscope on a 'party' cell is if there's no candidate (or it's dsv) and has_alliance is false (because if it was true then the alliance should have the scope), but for 'mixed' groupings I couldn't see how to determine in the lua code that that party isn't in an alliance. It's really not a big deal, but if anyone can see the solution easily, please do. --PresN 03:11, 13 April 2025 (UTC)
- Unfortunately the change you made messed up articles like 2001 Italian general election in Trentino-Alto Adige/Südtirol, so habve reverted for now. Number 57 18:10, 13 April 2025 (UTC)
- Thanks, I'll check out later today what I messed up with that if statement, and will get agreement before pushing again. --PresN 19:15, 13 April 2025 (UTC)
- @Number 57: Okay, I think I've gotten it all sorted out. I don't see any testcases at Template:Election results/testcases that have visual differences, or at the Trentino-Alto Adige/Südtirol list, and rowscopes all look to be where I expect them. As promised, not going to make the same mistake twice, so I'm not pushing to the main module - let me know if you see anything amiss. --PresN 01:31, 14 April 2025 (UTC)
- Thanks, I'll check out later today what I messed up with that if statement, and will get agreement before pushing again. --PresN 19:15, 13 April 2025 (UTC)
Embedding
[edit]I'm currently drafting a big revamp of 2002 Dutch general election. You can see my current progress here.
One thing I've noticed is that, while template:election results is more compact and sortable than a wikitable, it is inferior when it's used to supplant prose sections because it does not allow text to embed besides it. You can see this in my draft when comapring the section "Incumbent coalition wins re-election (1998)" to "Municipal elections and debate (6 March 2002)". I would appreciate if someone with more technical know-how than me would add embed parameters to this template. Koopinator (talk) 12:16, 23 April 2025 (UTC)
- Done. Just add floatright=yes to the code. I have updated the version in your sandbox to demonstrate. Number 57 22:36, 24 April 2025 (UTC)
Template for +/− seats
[edit]Is there any reason why the format for addition or subtraction uses an en dash (–) rather than a minus sign (−) in the template? Wikipedia discourages using anything other than a minus sign (see MOS:FORMULA), so is this an intentional exception, or a mistake that needs to be rectified? MrSwedishMeatballs (talk) 19:00, 28 April 2025 (UTC)
- Upon further inspection, this seems to be a problem with Module:Election results itself. Lua should support Unicode 1.1 characters, so it just needs someone high enough up to change it. MrSwedishMeatballs (talk) 19:14, 28 April 2025 (UTC)