Template talk:Archive
Template:Archive 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 Archive template. |
|
Archives: 1, 2, 3Auto-archiving period: 28 days |
This template was nominated for merging. Please review the prior discussions if you are considering re-nomination:
|
{{Archive navigation}} is down to around 150 uses on weirdly named pages that will probably have to be manually fixed. The 30 pages after User talk:Fish and karate/Archive 1 are easy to fix but will require an admin. {{Archive number}} was made to work with {{Archive navigation}} and it is now down to around 70 transclusions. The only page remaining with both[1] has a warning banner not to change it as it is some kind of demo? The remaining uses are kind of odd but all in userspace, like User talk:Little Mountain 5/Archive 12. If the template is not nominated for deletion, the documentation needs to be updated Template:Archive number/doc Rjjiii (talk) 06:08, 19 October 2024 (UTC)
- Down to 100 transclusions now. For some of the odder uses of archive nav, I think it's easier for us to just remove the template entirely. – 🌻 Hilst (talk | contribs) 12:12, 27 October 2024 (UTC)
- @Rjjiii: We're down to only Fish and karate's archives. I've left a message over at his talk page, but if you want to speed things up, feel free to ask someone at AN to do so. – 🌻 Hilst (talk | contribs) 13:15, 27 October 2024 (UTC)
- @Hilst First, thanks for going through and doing all of these types of edits to clean up.[2] And, Fish and karate seems fairly active, so I'll wait a week or so before reaching out to another admin. Rjjiii (talk) 13:56, 27 October 2024 (UTC)
- @I've fixed them all, I think. Thanks for letting me know. Ping me if I've missed anything. Cheers, Fish+Karate 14:01, 28 October 2024 (UTC)
- Thanks! I think that's all of them,[3] Rjjiii (talk) 14:17, 28 October 2024 (UTC)
- @I've fixed them all, I think. Thanks for letting me know. Ping me if I've missed anything. Cheers, Fish+Karate 14:01, 28 October 2024 (UTC)
- @Hilst First, thanks for going through and doing all of these types of edits to clean up.[2] And, Fish and karate seems fairly active, so I'll wait a week or so before reaching out to another admin. Rjjiii (talk) 13:56, 27 October 2024 (UTC)
- @Rjjiii: We're down to only Fish and karate's archives. I've left a message over at his talk page, but if you want to speed things up, feel free to ask someone at AN to do so. – 🌻 Hilst (talk | contribs) 13:15, 27 October 2024 (UTC)
Break
edit{{Archive navigation}} is now deleted, and the helper template {{Archive number}} has been nominated for deletion.[4] Rjjiii (talk) 18:07, 28 October 2024 (UTC)
- {{Archive number}} is now also deleted. I think that's it for the merge, Rjjiii (talk) 17:56, 9 November 2024 (UTC)
Possibilities for merging uncommon templates into this one?
editThere are several templates that make archive banners, that I am thinking could possibly be merged into this one. {{UserTalkArchive}} seems redundant but I may be overlooking something. Check out the sandbox for a proof of concept on on using {{archive|period=index}}
to replace {{Archive index}} and {{Archive-index}}.
I am not sure how difficult it would be to implement something like |period=annual
for pages using the format "Archive 2023, Archive 2024, etc.". I also wonder if there might be a way to detect situations where the year-based links of {{Annual archive}} would be appropriate ("Archive 1" does not exist but an page beginning with "Archive 20..." does?). Rjjiii (talk) 02:36, 29 October 2024 (UTC)
- {{UserTalkArchive}} has a slightly different blurb ("past discussions with X" vs "past discussions about X") and the box listing all archives. Other than that, it has the same functionality as {{Archive}}.
- I'm not sure if
|period=
is the correct parameter for implementing {{Archive index}}. Maybe it should get its own parameter? - Annual archives shouldn't be too hard to implement. We could just reproduce {{Yearly archive list}}'s logic (or, better yet, use the actual template with expandTemplate).
- – 🌻 Hilst (talk | contribs) 13:23, 30 October 2024 (UTC)
- Replying also in bullets:
- The blurb there makes slightly more sense, but it's not a huge difference. If the blurb here could be switched automatically on namespaces 2 & 3, it would make more sense, but again not a big deal. The box is an actual difference, but I don't know that it's a positive difference to have an arbitrarily different interface on a handful of talk pages.
- I'm not attached to "period=index" and would be fine with an
|index=
parameter. - expandTemplate is definitely the way to go. That should give the same output as the main talkpage banner for annual archives.
- Rjjiii (talk) 07:47, 2 November 2024 (UTC)
- @Hilst In the sandbox, I've added "index" as a possible value for a
|type=
parameter. I've also added a preposition that will change depending on namespace. This should make the blurb brought up by Andy more clear for user talk pages and noticeboards. I started to add "annual" as another|type=
and to try out expandTemplate, but there is too much there that I don't grasp, Rjjiii (talk) 20:23, 11 November 2024 (UTC)- Good changes! I'll look into doing the annual logic later. – 🌻 Hilst (talk | contribs) 12:38, 12 November 2024 (UTC)
- Thanks for looking into it. I started to do a proof of concept to see whether {{yearly archive list}} would make more sense inside the box where {{annual archive}} has it (which is probably the right place as it is), or below the box since the numbered links would need to be suppressed anyway for annual archives. I ran into the issue that about 50 or so pages do the annual archives with a complicated subpage format (User talk:User/Archives/20YY) which may not be worth it to add everything to support that for those 50 pages, :-/ Sorry if I've led you on a goose chase there. I will still likely push changes live for the namespace prepositions and index blurb, Rjjiii (talk) 07:46, 20 November 2024 (UTC)
- I think all the parameters work for an annual archive now, but am somewhat hesitant to add a bunch of parameters. The more I think about this, the more it seems like the correct thing to is to check the format ("Archive 20XX", "Archive/20XX", or "Archives/20XX"), check to make sure "Archive 1000" doesn't exist, and then intuit that the archive is annual. I'll probably leave this in the sandbox and push some other changes live this coming week. Rjjiii (talk) 17:34, 23 November 2024 (UTC)
- Thanks for looking into it. I started to do a proof of concept to see whether {{yearly archive list}} would make more sense inside the box where {{annual archive}} has it (which is probably the right place as it is), or below the box since the numbered links would need to be suppressed anyway for annual archives. I ran into the issue that about 50 or so pages do the annual archives with a complicated subpage format (User talk:User/Archives/20YY) which may not be worth it to add everything to support that for those 50 pages, :-/ Sorry if I've led you on a goose chase there. I will still likely push changes live for the namespace prepositions and index blurb, Rjjiii (talk) 07:46, 20 November 2024 (UTC)
- Good changes! I'll look into doing the annual logic later. – 🌻 Hilst (talk | contribs) 12:38, 12 November 2024 (UTC)
- Replying also in bullets:
Later archives not linked, take n+1
editTemplate talk:Automatic archive navigator/Archive 1#Bug: Missing links to next archives, regarding for example Wikipedia talk:WikiProject Chemicals/Archive 2015 not linking to 2016 and beyond, is still broken. DMacks (talk) 17:31, 23 November 2024 (UTC)
- @DMacks Did the solution that you and Mr. Stradivarius tried back then ever work for annual archives? The issue noted about Wikipedia talk:Manual of Style/Dates and numbers/Archive 145 seems fixed. When I preview Wikipedia talk:WikiProject Chemicals/Archive 2015 using this version of the module, I still don't see an "Archive 2016" link, instead the final link is an "Archive 2" red link. This even older version by Toohool from before the rewrite does correctly give the 2016 link. Also, is the desired output for annually archived page a row of navigation links like this template emits for sequential archives, or is it something more like the list that {{annual archive}} has in its banner? Rjjiii (talk) 18:39, 23 November 2024 (UTC)
- Fixed with this edit. I haven't checked to see if this broke anything else. – 🌻 Hilst (talk | contribs) 19:58, 23 November 2024 (UTC)
- @Hilst & DMacks, I would not describe this as broken, but try to preview the sandbox template ({{archive/sandbox}}) on this page which has annual archives but no navigation links right now: Talk:IEEE 1394/Archive 2004
- I'm wondering if this doesn't offer a better way to navigate than the link list that {{annual archive}} offers. Is there an easy way to suppress the red links to years not archived ("Archive 2000 ← Archive 2002" in this case), and would it be preferred to suppress them? Rjjiii (talk) 23:46, 23 November 2024 (UTC)
- @Hilst: That fix appears to work for me (alternately, the [https://en.wikipedia.org/w/index.php?title=Module:Archive/sandbox2&diff=prev&oldid=920507958 one I proposed back then does still applies cleanly to the current module and also still works). DMacks (talk) 12:12, 24 November 2024 (UTC)
- A demo with fake archives on my alt account:
- ☛ User talk:Rjjiii (ii)/Archive 2005
- The Sandbox(1) and Sandbox2 solutions work the same, but Sandbox2 requires an extra parameter. Both show all the archives, and both will create red links for years with no archives. {{Annual archive}} shows only the years with archives, but it is a bit fiddly. Rjjiii (talk) 07:25, 29 November 2024 (UTC)
- @DMacks, I've pushed the change live, thanks for following up on the bug. @Hilst Thanks again and feel free to reach out in the future. I'm going to hold off on trying to merge the annual archive template, Rjjiii (talk) 02:34, 12 December 2024 (UTC)
Incorrect for talk pages
editI tried adding this template to Wikipedia talk:WikiProject Military history/Requests for project input/Archive 1 but it generated incorrectly.
It says:
- This is an archive of past discussions on Wikipedia:WikiProject Military history. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.
What is should say is:
- This is an archive of past discussions on Wikipedia talk:WikiProject Military history/Requests for project input. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.
This template cannot be used on talk pages.
Hawkeye7 (discuss) 17:56, 11 December 2024 (UTC)
- @Hawkeye7: That's intended behavior. It links to the root talk page to prevent red links on pages like the one listed at Template talk:Archive/Archive 3 § The "current talk page" link will break for "/YEAR/Month" archives. I don't see why it
cannot be used on talk pages.
– 🌻 Hilst (talk | contribs) 20:37, 11 December 2024 (UTC)- I thought it would be more flexible than that. I have replaced it with a hand-written tmbox. Hawkeye7 (discuss) 21:17, 11 December 2024 (UTC)
- You can use the
|text=
parameter for a hand-written message.[5] I don't know if there's a clever solution to the many different usages of subpages. Before Andy Mabbet's suggestion,[6] the archive banner templates just didn't give a link. Rjjiii (talk) 02:44, 12 December 2024 (UTC)
- You can use the
- I thought it would be more flexible than that. I have replaced it with a hand-written tmbox. Hawkeye7 (discuss) 21:17, 11 December 2024 (UTC)
- @SilverLocust, Gonnym, and Plastikspork: the last four people to edit the module. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 08:29, 12 December 2024 (UTC)
- It probably can check if the current parent exists, if it does, use that, if it doesn't, use the root page. Gonnym (talk) 08:33, 12 December 2024 (UTC)
- @Gonnym: That seems sensible, Can it check for redirects, though? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 09:09, 12 December 2024 (UTC)
- A title object has
isRedirect
. There are also Module:Redirect and Module:Pagetype so between these three, I'm sure it's covered. Gonnym (talk) 11:04, 12 December 2024 (UTC)
- A title object has
- @Gonnym: That seems sensible, Can it check for redirects, though? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 09:09, 12 December 2024 (UTC)
- It probably can check if the current parent exists, if it does, use that, if it doesn't, use the root page. Gonnym (talk) 08:33, 12 December 2024 (UTC)