Posted 1254887290|%O ago by leiger
Auto-numbering categories is useful. Auto-renaming is just as useful. Intrigued? Read on.
A future project that I plan to work on requires that pages in a certain category be deleted after a certain period of time. For example, once a page in the "claim" category is 3 days old, it is soft-deleted (exception is for pages starting with an underscore, eg, the live template)
This could be done manually by using ListPages — listing all pages in the category alongside their creation dates — and deleting anything that has passed it's use-by date, but this is inefficient and I'm hoping it can be done automatically.
For example:
Date | Name of page created |
---|---|
1/10 12:00 | Page 144-235 created |
1/10 13:00 | Page 325-235 created |
2/10 12:00 | Page 345-235 created |
3/10 14:30 | Page 144-235 attempted, but page already exists |
4/10 12:00 | Page 144-235 auto-renamed to deleted:144-235 |
4/10 14:30 | Page 144-235 attempted, no such page, creation is successful |
So, at approximately 12:00 on the 4th of October, that page is automatically renamed from claim:144-235 to be deleted:claim:144-235, meaning that a new claim:144-235 can be created.
This would be a Site Manager setting, similar to how autonumbering is set up currently.
In this case:
{{prefix|claim:144-235|suffix}}Prefix is prefix|
Suffix is |suffix
Auto-numbering should also be supported by the prefix/suffix if possible. That would mean that a page called claim:144-235 is renamed to deleted:claim:144-235:1, then the next time a page of that name is auto-deleted it is renamed to deleted:claim:144-235:2, and so on.
If auto-numbering is disabled, then the previous deleted:claim:144-235 would be overwritten by the new one.
Due to it being customisable (i.e. length of time, prefix and suffix), I'm sure it could be used in a range of circumstances.
Is this possible? Would caching have an effect on this somehow?
I don't think I can put anything forward for it through the Roadmap site, but it is a feature that I'd really like to have available.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
The wiki I plan to implement this in has a large number of willing testers… in the range of 20-30 people, maybe even more. Most don't have a Wikidot account — yet.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
It's an interesting idea. Do you have any example other than automatic deletion? Then it could be configured simply as "Move pages to trash after ___ days", with the rest, such as preserving duplicates, being implied.
Portfolio
Have been thinking about this… but can't come up with any reasonably useful use cases. So yes, auto-delete would be great :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Is it true that this could function as an automated archiver, by moving a submission to stable category, where only, say, moderators can change the content?
Yes, exactly! At the moment the idea is to create an auto-delete option only, but you've just brought up a good use case of where using other categories would work just as well.
Someone posts, then after a few months it's automatically archived. Would work well with page-based forums to avoid people posting on 12-month-old topics.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)