Page MenuHomePhabricator

Mechanism for switching templates
Closed, ResolvedPublic

Description

Implement a mechanism that allows the user to switch client templates with Commons templates.
Note: in the tool CommonsHelper by Magnus there is already some functionality that does template magic. We should look into this and find out what it does.
Note 2: there are several templates that would prevent the transfer of a file

Event Timeline

I worked much of this out when writing For the Common Good, at least for enwiki.

  • The local wiki data files that describe the transformations ("replacements") and templates that prevent transfer ("potential problems") may be slightly out of date, but then CommonsHelper's logic probably is too. It would be great if you could combine the best of both into this new extension.
  • The C# code for the extension contains various template-switching logic, including transforming local {{Information}} templates into the Commons equivalent. See https://github.com/atlight/ForTheCommonGood/blob/master/ForTheCommonGood/frmMain.cs#L393-L641 I know the code quality is quite poor, but the logic has been well-received by users, and re-using this logic could help avoiding reinventing the wheel.

[Note added 2017-08-18: see T171605#3485931]

Change 339205 had a related patch set uploaded (by Addshore):
Outline importing & template switching

https://gerrit.wikimedia.org/r/339205

Change 339205 merged by jenkins-bot:
[mediawiki/extensions/FileImporter] Outline importing & template switching

https://gerrit.wikimedia.org/r/339205

Rough outline has been done, but moving back to TODO based on meeting discussions.