User talk:GKFX/sandbox

Latest comment: 2 years ago by GKFX in topic New test section

Asterisk

edit

I asked this also at Wikipedia:Templates for discussion/Log/2021 July 19#Template:Flaglist+link. But I need to be clearer, and to find out what's possible.

It would be nice if the country name was a link to the country page, or to the more specialized page (if it exists). The template would put an unlinked asterisk at the end of the country name to indicate a specialized link.

The asterisk could be explained in the column head, or just above the table.

Can a template do this? Can it determine if a specialized article exists? And then can the template use a simple country link if the specialized page does not exist? And can the template add an asterisk at the end of specialized links?

I have done a lot of editing of tables and country lists. And there is almost always a desire to narrow column widths. --Timeshifter (talk) 13:11, 16 July 2021 (UTC)Reply

Yes, it is possible for a template or module to query whether an article exists and render a link appropriately. However you are limited to 500 queries per article which might be problematic. If that's OK and you want that option coded into Module:Flagg then let me know. User:GKFXtalk 15:18, 16 July 2021 (UTC)Reply
So I guess there is little or no querying normally with this template? I see that this page has many tables using {{flagg}}:
List of sovereign states and dependencies by total fertility rate
Are there WP:PEIS limits with the normal use of {{flagg}}? I have no idea.
It looks like {{flagg}} leaves a red link when a specialized page does not exist. So it is not querying.
Maybe a solution that avoids querying would be for {{flagg}} to add an asterisk by default after all country names. Then the Wikipedia editor looks for red links and fixes them by removing the parameters.
{{flagg||France}}
  France
The asterisk could be explained by editors in the country column head, or in a note just above the table. This would help with the WP:EGG problem.
Of course that would be a lot of work for some country lists with a lot of red links.
In that case it would be useful if {{flagg}} had an option that allowed it to do the work.
For country lists with just one table, then a limit of 500 queries would not be a problem?
I don't know how this works. The Wikimedia software only does this querying after the page is edited? Or does it do it every time the page is loaded by any random reader?
About the asterisk. Maybe the asterisk could be added (by editors) only to normal (non-specialized) country links.
But I think it is more intuitive if an asterisk is added to the specialized country links: For all the tables {{flagg}} is currently used in.
Readers would soon learn what the asterisk means even if editors don't get around to explaining it in the column head or in a note above the table.
--Timeshifter (talk) 21:12, 16 July 2021 (UTC)Reply
@Timeshifter: {{flagg}} is the best option available regarding WP:PEIS limit issues; it's not completely immune to them but it's pretty good. It turns out there is an option to do the querying with an f after the other options so I will leave that as is.
Page rendering is cached, so the queries definitely get re-run after you edit or purge the page but don't get re-run every time the article is viewed. I'm not sure if creating or deleting one of the articles will automatically invalidate the relevant cache to correct the result of the query, but I presume it works well enough as people use {{#ifexist:}} all the time without issues.
I've coded up what you suggest so you can have a look back at User:GKFX/sandbox and see what you think; the countries without an "Economy of" page get a link to just the country page. I wonder if it might be better to narrow the columns by wrapping long country names rather than manipulating the links though. User:GKFXtalk 20:45, 18 July 2021 (UTC)Reply
Thanks GKFX. I like it. I cleaned up and simplified the wikitext at the top. See
User:Timeshifter/Sandbox140
The country names wrap now. I removed class=nowrap from the top wikitext.
I prefer the asterisk to "Economy of" in the country name cells.
Because in some narrower screens the table length would almost double due to the second line caused by "Economy of"
This can be tested by narrowing your browser width until you find that some of the country names (with "Economy of") are wrapping.
Then one would keep narrowing to see more country names wrapping.
Of course you would have to find an example table using "Economy of" exposed in the country name cells. I don't know where one is now.
Removing "Economy of" from the country name cells allows the table to be shorter in a wider range of table widths.
I see that this table is from List of countries by past and projected GDP (nominal) per capita.
--Timeshifter (talk) 03:01, 19 July 2021 (UTC)Reply

Asterisk. Part 2

edit

GKFX. Finally getting back to you about this. I want to use {{flagg}}, querying, and the asterisk in country lists with just one or 2 tables.

There is an example table in this sandbox:

Could you code it into the necessary templates, etc.? --Timeshifter (talk) 02:00, 18 August 2021 (UTC)Reply

Pppery did it. See:
User talk:Pppery#Re: Template:flaglist+link
--Timeshifter (talk) 18:04, 26 September 2021 (UTC)Reply




New test section

edit

Test blah blah blah. User:GKFXtalk 23:18, 20 December 2021 (UTC)Reply

Yo @GKFX. GKFX-2 (talk) 23:26, 20 December 2021 (UTC)Reply
Wassup. GKFX-2 (talk) 23:27, 20 December 2021 (UTC)Reply
Blah. GKFX-2 (talk) 23:34, 20 December 2021 (UTC)Reply
X. User:GKFXtalk 23:37, 20 December 2021 (UTC)Reply
Q. User:GKFXtalk
10:13, 28 December 2021 (UTC)Reply