Template talk:Archives
Template:Archives is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
This is the talk page for discussing improvements to the Archives template. |
|
This template was considered for merging with Template:UserTalkArchiveBox on 16 August 2021. The result of the discussion was "keep". |
Index
|
|||
This page has archives. Sections older than 90 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Edge case
edit@Mathglot The change to auto-generate broke my user talk page, where I use two archiving configs to archive certain messages instantly to a separate notifications subpage. The two configs have two different ages to prevent normal messages from being automatically archived to the notifications subpage. Currently, I set one of the boxes to not auto-generate, but I can't get the correct age to show. Aaron Liu (talk) 12:49, 23 April 2024 (UTC)
- Checking... Mathglot (talk) 17:50, 23 April 2024 (UTC)
- Aaron Liu, thanks for adding this bug report. When the auto-generate upgrade was designed, it did not foresee the case where a page (like your Talk page) would have two separate archive configs on the page, and so when it looks for the config, it just picks the first one it finds and assumes that's the right one. For most pages, that works, but obviously for your page, which has two configs, it does not. The fix will involve a new optional parameter (name t.b.d. but maybe
|config_number=
; suggestions welcome). So after the fix, in your second archive config, it will look like this:{{archives|title=Notifications|config_number=2|...}}
- Brief analysis: Template:Archives calls Template:Talk header/archivebotparse to do the parsing, and in a couple of places, archivebotparse calls {{Template parameter value}} to grab the config. The third positional parameter (TEMPLATE-COUNT) currently is hard-coded to 1, which causes the problem in your Notifications archive box.
- Repair design: archivebotparse should pass the value of the new config_number parameter to {{tmpv}} in position 3, passing
1
as the default value if there is no such parameter. - Testing: The design and implementation of the fix is quite simple at the sandbox level, but because the change affects both the {{Archives}} and {{Talk header}}, both highly visible templates, careful testing is needed before release – it needs to have a new test case added (ideally, a few contrasting ones) and both templates will have to be checked. I don't anticipate any problems with that, it's just that it may take some time. Are you okay with this for the time being?
- A good way to proceed imho, as well as to get you up and running sooner rather than later, is to go ahead and make the sandbox changes (one to archivebotparse/sandbox, and one to Archives/sandbox to invoke it), which could be done fairly quickly and then use your page as a tester. This would involve changing your {{Archives}} invocations on your page to {{Archives/sandbox}} instead, and adding the new param. If it works, great, and you'll be the first/only one to benefit from it for a while, while testing is ongoing. When it's fully tested and the new version is finally released, you just self-revert (i.e., go back to the regular, non-sandbox version on your Talk page) and it will continue working as desired. How does this plan sound to you? Adding Aidan9382. Mathglot (talk) 18:44, 23 April 2024 (UTC)
- Adding a template count to grab a specific instance would be fine. Also, you don't need to pass 1 as a default value if config_number isnt specified, since tmpv will default to 1 itself. The only remaining edge case that wouldn't (couldn't) solve would be if they used 2 different archiving bots actively, but that's very rarely done, and generally for good reason, since it can get messy. You could potentially just allow the user to specify a certain bot if that's a case you also want to worry about. Aidan9382 (talk) 19:11, 23 April 2024 (UTC)
- So TL;DR what I would need to do is change my archives templates to their sandbox versions after you lovely people finish construction? That sounds good to me.In my opinion there should be a way to actually disable the auto-generation. Currently I can't specify the archival age after disabling. Aaron Liu (talk) 19:24, 23 April 2024 (UTC)
- (edit conflict) Right, but we're not quite there, yet. There is a way to disable it: add
|nobot=yes
to the invocation. Just tested this in Preview mode (without saving) on your UTP, and it works. (It leaves a rump statement, 'This page has archives' which should probably be removed, but the bot notice about archiving is suppressed.) This is documented at Template:Archives#Archive bot config, with an illustration in the #Usage section, but TemplateData needs to be updated for those using VE. Mathglot (talk) 19:48, 23 April 2024 (UTC)- What I want is for the statement in the first box to say
This page has archives. Sections older than 30 days may be automatically archived by ClueBot III.
I have added the|age=30
parameter but it does not work. Aaron Liu (talk) 21:04, 23 April 2024 (UTC) - You don't need to (and shouldn't) add that parameter; it is deprecated. The autogeneration derives it automatically from the config, preventing it from getting out of sync. Previously, it didn't work for multiple configs as in your case, but now that the sandbox version has been created and is in testing, it is usable on an alpha-test basis. See how your Talk page looks now, calling the sandbox instead of the live template, and if the page now looks the way you want it. Mathglot (talk) 01:31, 24 April 2024 (UTC)
- Having nobot actually turn off the features would still be useful in 1. edge cases we haven't seen yet 2. my talk page, where the "Index link" currently links to the indices for the normal archives, yet is linked to in the notifications box.
Anyways, thanks for the help! This is still tremendously better. Aaron Liu (talk) 01:35, 24 April 2024 (UTC)- I'm glad it's better, though I admit to not understanding the rest of that comment. I also don't understand the edit summary here about not wanting the "95 days", and something about instant archival; how can the archival be instant if you've specified 95 days in the config? Feel free not to explain if you're happy with how it is now, just wanted to say I'm pretty much in the dark, here, and if there might still be bugs that would affect performance for others with two configs, it would be better to know about it sooner rather than later. (I do understand my earlier mix-up in the links in the two configs which you subsequently fixed; no explanation needed there.) Mathglot (talk) 02:01, 24 April 2024 (UTC)
- The notifications config (theoretically) instantly archives anything that contains certain pieces of text. It has a longer duration than the other 30 days duration, so that Cluebot doesn't archive any normal messages to the notifications subpages.The notifications config also has nogenerateindex. As a result, Cluebot's generated indices are for the normal config only. Aaron Liu (talk) 02:55, 24 April 2024 (UTC)
- Don't worry about this anymore, I've discovered the
|index=none
parameter. Aaron Liu (talk) 17:19, 24 April 2024 (UTC)
- Don't worry about this anymore, I've discovered the
- The notifications config (theoretically) instantly archives anything that contains certain pieces of text. It has a longer duration than the other 30 days duration, so that Cluebot doesn't archive any normal messages to the notifications subpages.The notifications config also has nogenerateindex. As a result, Cluebot's generated indices are for the normal config only. Aaron Liu (talk) 02:55, 24 April 2024 (UTC)
- I'm glad it's better, though I admit to not understanding the rest of that comment. I also don't understand the edit summary here about not wanting the "95 days", and something about instant archival; how can the archival be instant if you've specified 95 days in the config? Feel free not to explain if you're happy with how it is now, just wanted to say I'm pretty much in the dark, here, and if there might still be bugs that would affect performance for others with two configs, it would be better to know about it sooner rather than later. (I do understand my earlier mix-up in the links in the two configs which you subsequently fixed; no explanation needed there.) Mathglot (talk) 02:01, 24 April 2024 (UTC)
- Having nobot actually turn off the features would still be useful in 1. edge cases we haven't seen yet 2. my talk page, where the "Index link" currently links to the indices for the normal archives, yet is linked to in the notifications box.
- Note for Aidan: the long name of the parameter
|config_number=
causes some undesirable line wrapping in the view window that I'd like to eliminate or minimize as much as possible; am thinking of shortening it to cnbr, cno, cf, or just n. It will be used so rarely I don't think a highly mnemonic param name is needed for this param, and the shorter the better, to keep the preview code more legible for editors. How about just|n=
? Mathglot (talk) 01:35, 24 April 2024 (UTC)- I think just
|n=
might be a bit ambiguous when overlooking usages of the template ("n of what?").|config_n=
could be a good middle ground between the two. Aidan9382 (talk) 13:38, 24 April 2024 (UTC)- How about just
|cfg=
? Aaron Liu (talk) 14:06, 24 April 2024 (UTC)- That works for me; stand by... Mathglot (talk) 19:43, 24 April 2024 (UTC)
- Okay, that change is in, now. This is a breaking change with respect to your Talk page, so if you wish to pick up the changes, please change your UTP sandbox call to use
|cfg=
instead of 'config_number'; thanks. Mathglot (talk) 20:34, 24 April 2024 (UTC)
- How about just
- I think just
- What I want is for the statement in the first box to say
- (edit conflict) Right, but we're not quite there, yet. There is a way to disable it: add
Next step: create some test cases. (Aaron, your UTP is a kind of live test case, and an initial hint that the code might be working, at least in that one case, but not anything like a complete demonstration of it at the level of confidence that we would need for a highly visible template.) I may not get to the test cases immediately, but anyone is welcome to create them. One idea would be to add a dozen or so configs to the /testcases page, and have the test cases link to them via the new |cfg=
param. We would also have to have some regression tests to make sure that the far more usual case of only a single config per page still works properly. Mathglot (talk) 21:34, 24 April 2024 (UTC)
Unrelated sandbox changes
editAaron: I have undone your changes to Archive template bot notice wording and the way param |nobot=
works in Template:Archives/sandbox. Once the current changes for the multiple-config upgrade have been tested and released to live, then you can pick up the sandbox and make other changes to wording or to functionality of the params. Or, feel free to make your changes to Template:Archives/sandbox2, and develop them there. Thanks. Mathglot (talk) 20:07, 24 April 2024 (UTC)
- Well, I didn't make any changes to the wording. The diff displays weirdly when inline, but all I did was take the nobot if condition out and wrap the entire td body instead, plus unindenting the originally wrapped part. I don't think it'll cause any problems. Aaron Liu (talk) 20:12, 24 April 2024 (UTC)
- I'm sure you're right, and if you want to take over this development and release the multi-config upgrade along with your changes at the same time, I am fine with that and I'll stop and hand it off to you, and you can revert my change and continue as you wish. But I won't continue or move anything to live under my sig with both sets of changes in there at the same time. Please lmk how you would like to proceed. Mathglot (talk) 20:31, 24 April 2024 (UTC)
- Either is fine to me, though I'd prefer you deploy the multi-config upgrade first, as I am unfamiliar with such things and can always do an edit request later. Thanks again for your timeliness. Aaron Liu (talk) 21:04, 24 April 2024 (UTC)
- Okay, I'll carry on with the initial plan; thanks. Mathglot (talk) 21:16, 24 April 2024 (UTC)
- Hey @Mathglot, how's it going? What things do we need to test before this is merged to the main template? Aaron Liu (talk) 11:45, 22 May 2024 (UTC)
- Hi, Aaron. Not forgotten, but somewhat in suspension for a couple of reasons: one is, I’m away for a few weeks and I can thumb-type Talk messages on my phone, but wouldn’t dare do template changes of this nature that way. But more importantly, there’s some stuff going on at Template:Talk header that should complete before this; it may be done already and then I can tackle this when I get back. Remind me around 20 June if you haven’t heard anything before that. And, thanks for the reminder! Mathglot (talk) 11:59, 22 May 2024 (UTC)
- Back, and should be able to look into this again soon. Mathglot (talk) 23:18, 17 June 2024 (UTC)
- Hey @Mathglot, how's it going? Aaron Liu (talk) 23:00, 28 June 2024 (UTC)
- Back, and should be able to look into this again soon. Mathglot (talk) 23:18, 17 June 2024 (UTC)
- Hi, Aaron. Not forgotten, but somewhat in suspension for a couple of reasons: one is, I’m away for a few weeks and I can thumb-type Talk messages on my phone, but wouldn’t dare do template changes of this nature that way. But more importantly, there’s some stuff going on at Template:Talk header that should complete before this; it may be done already and then I can tackle this when I get back. Remind me around 20 June if you haven’t heard anything before that. And, thanks for the reminder! Mathglot (talk) 11:59, 22 May 2024 (UTC)
- Hey @Mathglot, how's it going? What things do we need to test before this is merged to the main template? Aaron Liu (talk) 11:45, 22 May 2024 (UTC)
- Okay, I'll carry on with the initial plan; thanks. Mathglot (talk) 21:16, 24 April 2024 (UTC)
- Either is fine to me, though I'd prefer you deploy the multi-config upgrade first, as I am unfamiliar with such things and can always do an edit request later. Thanks again for your timeliness. Aaron Liu (talk) 21:04, 24 April 2024 (UTC)
- I'm sure you're right, and if you want to take over this development and release the multi-config upgrade along with your changes at the same time, I am fine with that and I'll stop and hand it off to you, and you can revert my change and continue as you wish. But I won't continue or move anything to live under my sig with both sets of changes in there at the same time. Please lmk how you would like to proceed. Mathglot (talk) 20:31, 24 April 2024 (UTC)
Continuing
editHi, Aaron. I'm reviewing this again to remind myself where we are and see what needs to be done to bring it to completion. Sorry for delays and thanks for the ping. Iirc, everything is already in place in the sandbox, we needed a (or some) test case(s), and the sandbox testing version has been on your page for a while now, I believe. So, let's start there, first: has the sandbox version of the {{Archives}} template been on your Talk page during this entire time, and what's your general impression? Has it been doing what it ought to, for both boxes, and have you have observed any issues? Have you tried fiddling with the params to observe different results, and if so, how did that go? Mathglot (talk) 19:14, 23 July 2024 (UTC)
- I've fiddled with it a bit and it's been alright on my talk page, though the sandbox talk using sigmabot seems to have broken. Aaron Liu (talk) 04:01, 24 July 2024 (UTC)
- Thanks, I'll look at that. There's a {{void}} template around the two configs, which shouldn't affect it, I don't think, so it may be something else. Mathglot (talk) 04:29, 24 July 2024 (UTC)
- The {{void}} has nothing to do wit it, as I thought. There are some layers of issues, starting with the fact that the Archives sandbox had moved on, so I restored it to the proper test version for testing this. (If others are working simultaneously on it, we might have to switch to sandbox2.) Next step, I have to look at the config parsing routine, to see if it is handling parsing of hours correctly, but I'm done for today. Mathglot (talk) 07:53, 24 July 2024 (UTC)
- I don't think that having two
{{User:MiszaBot/config}}
on the same page is permitted. At best, one of the two will be ignored, but it's possible that the bot will use some parameters from one and some from the other. --Redrose64 🌹 (talk) 17:44, 24 July 2024 (UTC)- Reading the source code, it indeed doesn't support that. It just reads the first config and takes it (at least that's how I assume next() to work for Python iterators).
@Mathglot I guess we could just change it to a preview warning if|cfg=
points to a Sigmabot config. Aaron Liu (talk) 22:21, 24 July 2024 (UTC)- Interesting; I had been testing and doing some searching around, and had started to compose a message over at User talk:Lowercase sigmabot III/Archive HowTo, which might still be worthwhile, although I'd have to change it now. I wanted to compile some data first before writing it, and so here are two advanced searches showing 39 Talk pages and 50 user talk pages with MiszaBot configs. (The searches will likely return results and time out before completing, so your numbers might be different.) I like the Preview warning idea. Am going to take a break and think about all this and where to go next, but I'm interested in your thoughts. Mathglot (talk) 00:18, 25 July 2024 (UTC)
- Reading the source code, it indeed doesn't support that. It just reads the first config and takes it (at least that's how I assume next() to work for Python iterators).
- @Mathglot: Regarding, "
If others are working simultaneously on it
", I don't have anything to test right now. I will likely post to Wikipedia talk:Manual of Style/Accessibility at some point in the future about best practices for "alt" parameters for icons. Also, a ping to andrybak in case I interrupted anything. Take care, Rjjiii (talk) 05:04, 25 July 2024 (UTC)- And at this moment, neither do I, as I have to switch gears and think about a possible new direction here. I've left a dummy edit welcoming a revert of my restoration of the test version for this; would have undone so myself, but there was a subsequent edit. Mathglot (talk) 07:19, 25 July 2024 (UTC)
- I don't think that having two
Hey @Mathglot, how's it going? Since no errors have arisen, my personal opinion is that we should just test it on a few more talk pages and merge it, especially since there are very few talk pages these changes would affect. We can always work on the bug reports later. That said, you're still the experienced one and I trust your judgement, whatever it is. Aaron Liu (talk) 13:08, 2 October 2024 (UTC)
- Thanks for the reminder, and sorry for the delay. I think I was trying to juggle too many things at once, and there was one other feature here that also dragged out that just got released finally, which should make it easier to attend to this one. Still a bit overwhelmed, but this is now top of stack for this template. Bear with me, and don't hesitate to ping again if it drags on. Mathglot (talk) 00:00, 4 October 2024 (UTC)
Automatic bot detection in Template:Monthly archive list
editA popular archiving scheme is Talk:Article name/Archives/<year>/<Month>
For this scheme, template {{Monthly archive list}} is used with parameter |root=Talk:Article name/Archives
. E.g. at Talk:Paris metropolitan area (subpages).
The recently added automatic archival bot detection uses the parameter |root=
as the name of the page, where the archival template is expected to be. The Archives
part of the parameter |root=
breaks this code.
I've come up with a workaround for Template:Monthly archive list (see Special:Diff/1222200740 and Special:Diff/1222200780), but it isn't great. Any ideas for how to improve the situation? —andrybak (talk) 15:02, 4 May 2024 (UTC)
- Andrybak, Thanks for raising this. Only just glanced at this, but my first impression is that the
root
param usage at {{Archives}} after that change is overloaded, as it looks like prior usage was different. If that stands up to analysis, then the fix is to use a different param name for the new occurrences seen in the right side of the diff, while leaving the old ones alone. I need to understand better what the previous usage was for, and whether there really need to be two params, or just one with better template code to deal with it. A complication is that I'm a bit overextended, with an #Edge case involving double bot configs already in the sandbox and in testing here, as well as a related change to template {{Talk header}} about to be released, followed by dealing with the edge case there, as well. On top of that, I'll be away for a month soon. So, my question is, can you hang on with the workaround until, say, late June or would that be too annoying? If not, there could be a quick fix of just renaming the new occurrences of that param to something else (base
?) which will likely fix your issue, but the problem is it would have to be thoroughly regression tested to make sure it doesn't break anything. (I wish your case had been in the test cases previously; it would've avoided this.) One approach could be, to code that change quickly in the sandbox without releasing it, and then invoke the sandbox from Template:Monthly archive list. That would fix it there, but not in other templates where it appears (apparently few to no others), without risking breaking stuff all over if an insufficiently tested sandbox version is released to live, but buy us time for a thoroughly analyzed and tested fix. Lmk what you think. Thanks, Mathglot (talk) 21:34, 5 May 2024 (UTC)- Mathglot, of course, there is no rush. For the page Talk:Paris metropolitan area, we could even restore the previous manual listing of the archives as in Special:Permalink/1212170688. Parameter
{{{root-override}}}
could be dropped from {{Monthly archive list}}, so that it doesn't confuse people – page Talk:Paris metropolitan area is its only usage. - The interactions between the templates are indeed tricky, especially since a single usage in one place affects multiple pages at once. Semi-related: yesterday, it took quite a while (one, two, three debug outputs) to diagnose a bug in {{Annual archive}}. —andrybak (talk) 21:49, 5 May 2024 (UTC)
Parameter
– done: Special:Diff/1222425107 + Special:Diff/1222424982. —andrybak (talk) 21:52, 5 May 2024 (UTC){{{root-override}}}
could be dropped from {{Monthly archive list}}- (edit conflict) Thanks. I hear you. In this comment at a template Talk page recently I alluded to a missing WP shortcut with a red link there, that will likely resonate with template editors. Maybe it should be turned blue and point somewhere... If you want to take a look at previous usage of 'root' here and comment, that might speed things along, and in the meantime, the live-test-using-sandbox approach might be a good one, given the low number of other templates that transclude this one (that 'few' link above). Mathglot (talk) 22:35, 5 May 2024 (UTC)
- How were you able to drop the override param? Isn't that (temporarily) needed for the Paris page, until the problem here is fixed? Mathglot (talk) 22:40, 5 May 2024 (UTC)
- The notice about the bot is not strictly necessary. Editors at Talk:Paris metropolitan area will manage without it. —andrybak (talk) 22:46, 5 May 2024 (UTC)
- Got it; thx. Mathglot (talk) 22:52, 5 May 2024 (UTC)
- The notice about the bot is not strictly necessary. Editors at Talk:Paris metropolitan area will manage without it. —andrybak (talk) 22:46, 5 May 2024 (UTC)
- How were you able to drop the override param? Isn't that (temporarily) needed for the Paris page, until the problem here is fixed? Mathglot (talk) 22:40, 5 May 2024 (UTC)
- Mathglot, of course, there is no rush. For the page Talk:Paris metropolitan area, we could even restore the previous manual listing of the archives as in Special:Permalink/1212170688. Parameter
Need to take another look at this soon. Mathglot (talk) 08:10, 12 June 2024 (UTC)
- The dual-archive box case should be completed soon, and then we can address this again. Mathglot (talk) 19:18, 23 July 2024 (UTC)
What does TemplateData do on the doc page?
editFunandtrvl added TemplateData to the documentation subpage in 2021.[1] TemplateData is used mainly by the Visual Editor. For some templates it is used by other visual interfaces (like ProveIt) or bots (like Citoid). The Visual Editor doesn't work on talk pages though, so I'm not sure what it's for. Rjjiii (talk) 14:29, 12 June 2024 (UTC)
- Confused about your question. A doc subpage like {{Archives/doc}} is in Template space (e.g. ,
{{NAMESPACE|Template:Archives/doc}}
⟶ Template, not Talk) and the doc page is transcluded onto the Template page, so also Template space. Can you clarify? Mathglot (talk) 17:43, 12 June 2024 (UTC) - The 2017 wikitext editor uses TemplateData as well, and works on Talk pages. Tollens (talk) 17:52, 12 June 2024 (UTC)
- Rjjiii, VE does in fact work on talk pages. — Qwerfjkltalk 16:31, 13 June 2024 (UTC)
- It's also useful for the template parameter report which I used several times when I worked on this template. Trialpears (talk) 22:30, 13 June 2024 (UTC)
- Okay, I'll try to update it soon. I wasn't initially sure if it should be removed or updated, Rjjiii (talk) 00:38, 14 June 2024 (UTC)
- @Trialpears: before I touch the TemplateData, do you know why the template parameter report only shows 19 pages? Rjjiii (talk) 03:33, 18 June 2024 (UTC)
Why have "alt" and "link"?
editThese two parameters just seem like something for editors to trip on. The link can be determined from the |image=
parameter, and the alt text should consistently be something like "archive icon" or "filing icon", right? Rjjiii (talk) 03:36, 18 June 2024 (UTC)
- I've removed them in the sandbox and placed examples on this testcases subpage:
- Template:Archives/testcases/Remove alt and link
- These are both easy to mess up and offer little value to most editors, Rjjiii (talk) 08:21, 4 July 2024 (UTC)
Why have "alt" and "link"?
Here's the edit that added the documentation for these two parameters: [2] I'm too lazy to go through the code, but this should give you a starting point in answering the question. CapnZapp (talk) 08:51, 4 July 2024 (UTC)
- I feel like I understand the purpose now, but I think the parameters should be taken out. Together they are asking an editor to understand Web accessibility and intellectual property laws (which are both complex) in order to change the icon (which could be simple). I think this sets an editor up to cause confusion. I have previously noticed something similar with the typographic character templates {{dagger}}, {{double-dagger}}, and {{hash-tag}}. These all had
|alt=
parameters but they were pretty widely misused. The alt paramters are still present in articles even though they no longer do anything. If active they could produce alt attributes that are confusing, unhelpful, not valid, misused to create tooltips, awakwardly verbose, or bad for accessibility. Rjjiii (talk) 02:05, 7 July 2024 (UTC)- Based on responses at Wikipedia talk:Manual of Style/Accessibility#Alt text for icons in templates, I think both parameters should be deprecated and removed. I'll hold off until the more complicated issues above are addressed. Rjjiii (talk) 00:22, 14 October 2024 (UTC)