Module talk:European and national party data/Archive 1: Difference between revisions

Content deleted Content added
Line 320:
:::::As for the last question, when I call <code><nowiki>{{#invoke:EUPP seats|composition_bar|ms-lower-house|Patriots}}</nowiki></code> or <code><nowiki>{{EUPP composition bar|ms-lower-house|Patriots}}</nowiki></code> from my user sandbox, it works (it finds 734 seats (which accounts for the redundant last line of the table). However, when calling <code><nowiki>{{EUPP composition bar|ms-lower-house|thisparty}}</nowiki></code> from the page Patriots.eu, it gives 608 (which does not include the last line of the table, which is not capitalised. [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 14:30, 6 April 2025 (UTC)
::::::OR maybe we can force uppercase for the first column when we import the table via the config function? [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 14:55, 6 April 2025 (UTC)
::::::{{ec}}
::::::As you wish.
::::::
::::::<syntaxhighlight lang="wikitext" inline="1">{{EUPP composition bar|ms-lower-house|Patriots}}</syntaxhighlight> doesn't 'work' because in [[Module:EUPP_seats#L-436--L-442|lines 436–442]], you do not do the upcasing thing.
::::::
::::::Alternate solution: Because we copy the tabular data file into a lua sequence, we can, as we read the data, upcase <code>european_party</code>. Add this at [[Module:EUPP_seats/config#L-123|line 123]]:
:::::::<syntaxhighlight lang="lua" inline="1"> row_data_t.european_party = row_data_t.european_party:upper(); -- ensure <european_party> values are always uppercase</syntaxhighlight>
::::::Do nothing else; then look at [[Patriots.eu]].
::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 14:59, 6 April 2025 (UTC)