Jump to content

Template talk:Navigation page

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

Quoted search as default

[edit]

I've implemented a sandbox version with quoted search as default; use |noquote=yes to do unqouted search, but for at least some (most?) pages, quoted does a better job. Click the search links in each case and note the difference in results:

Live: {{Navigation page|yes|Glove_and_Boots}}
Sandbox: {{Navigation page/sandbox|yes|Glove and Boots}}
Sandbox: {{Navigation page/sandbox|yes|Glove and Boots|noquote=yes}}

The {{plain link}} template was a bit of a pain in the neck, so I got rid of it. No objection to anyone restoring it. Not sure who to ping, here, maybe @Chaotic Enby and MrPersonHumanGuy:.Thanks, Mathglot (talk) 00:14, 19 April 2025 (UTC)[reply]

I decided to solve the the search link rendering problem by replacing {{plain link}} with a link to Special:Search. – MrPersonHumanGuy (talk) 02:00, 19 April 2025 (UTC)[reply]
That seems to have broken the search link entirely when a pagename is provided. I reverted those edits, and installed the working sandbox version, which is now live, including the new |noquote= param, which is now live. See Template:Navigation page/testcases. Mathglot (talk) 09:14, 19 April 2025 (UTC)[reply]
I also added {{namespace detect}} to both this template and its sandbox counterpart to prevent non-articles from being accidentally categorized. – MrPersonHumanGuy (talk) 12:07, 19 April 2025 (UTC)[reply]
[edit]

I just realized there is the separate {{Navlinks}} template and that the two are out of sync. Navlinks is the more fragile one and I would recommend replacing it with the current code from the links-generating portion of {{Navigation page}}, and then updating {{Navigation page}} to call {{Navlinks}}, or they will just get out of sync again. Mathglot (talk) 06:57, 20 April 2025 (UTC)[reply]

 Partly done: I made the change you suggested for {{navlinks}}, but when I looked at replacing the source in this template with a transclusion of that template, testing via previewing revealed that doing so would cause the nostart parameter to no longer be able to hide the "start the article" link like it's supposed to, effectively making it useless. nostart still works for the navlinks template itself though. – MrPersonHumanGuy (talk) 18:16, 20 April 2025 (UTC)[reply]
Thanks. I'll have a look into that when I get a chance. Mathglot (talk) 19:26, 20 April 2025 (UTC)[reply]

MrPersonHumanGuy, the new version is in the sandbox, and I've added test cases 4 & 5 for it. I was never too clear on what nostart was all about, so could you have a look and see if you see any problems with it? An extra benefit if we release it like this is that the Navigation page template will become easier to understand and modify, dropping from 1,368 bytes to 703, and a less nested structure, in addition to keeping it in sync with {{navlinks}}.

In order to make it work without breaking {{navlinks}}, since positional param 1 is already taken in {{Navpage}}, I added the nostart param as a named parameter, so to invoke the sandbox version, you do:

Show results of: {{navigation page/sandbox|yes|Glove and Boots|nostart=yes}}
{{navigation page/sandbox|yes|Glove and Boots|nostart=yes|nocat=true}}

You can also:

which works (I think; but please verify) but in {{navlinks}}, nostart is positional param 1 whereas here it is a named param, that is, you have to pass |nostart=yes (or 1, or true). This will drive users of the two templates nuts, trying to remember which one has the named param, and which has positional param 1.

The fix is easy, but is a breaking change, so I wanted to check with you first. It requires changing {{Navlinks}} to use named parameter |nostart=yes to enable the feature, followed by a change to {{navpage}} to pass the named param, instead of converting it from named to positional param 1. This will break all uses of {{navlinks}}, but fortunately there is only one mainspace page that transcludes it, namely Amari McCoy, and two other pages, both in Template space.

So, if you are okay with it, I will make the change to have both templates use |nostart=yes, which will break Amari McCoy briefly (it will show a start page link) which we can then adjust so it works the new way, and fix the two template space cases as well. Please lmk if you are good with this change, and I will go ahead. Thanks, Mathglot (talk) 22:12, 20 April 2025 (UTC)[reply]

You can try. In case your current idea doesn't work, you can keep trying different approaches until you find one that works. Two phrases come to my mind:
MrPersonHumanGuy (talk) 23:11, 20 April 2025 (UTC)[reply]
 Done. Everything should be good, now, but an extra set of eyeballs would be good, because you might have some cases that I am not aware of.
Positional param 1 having just a 'yes' value and no name is a bit unconventional. Really, it should be named param |navlinks=yes (or just, |links=yes ). The only other issue I am aware of is that |noquote= should use {{yesno}} but doesn't; this may trip somebody up who codes |noquote=no which will be interpreted the same as as a |noquote=yes (because it is just a presence test), if you feel like taking either of those on. I'm a bit Nav'ed out. Mathglot (talk) 23:59, 20 April 2025 (UTC)[reply]