Page MenuHomePhabricator

Add image syntax to explicitly display a file from either Commons or local wiki
Open, Needs TriagePublic

Description

If both the local wiki and Commons have a file with the same name, the local file is always displayed. It would be useful to have a method by which one or the other could be explicitly specified in the image use syntax. e.g. for a Foo.jpg:

  • [[File:Foo.jpg]] - Display a local image if one exists, if no local image exists displays a Commons image if one exists, if neither exist displays a redlink.
  • [[File:Foo.jpg|source=local]] - Displays a local image if one exists, otherwise displays a redlink. The presence or absence of an image on Commons is ignored.
  • [[File:Foo.jpg|source=commons]] - Displays a Commons image if one exists, otherwise displays a redlink The presence or absence of a local image is ignored.
  • [[File:Foo.jpg|source=local|source=commons]] - Displays an error
  • [[File:Foo.jpg|source=blah]] - Displays an error
  • [[File:Foo.jpg|source=de]] - Unsure (options include: display image from de, display error, alias for source=local on de some other option elsewhere)

("host", "wiki" and "repository" are other possibilities for the parameter name)

  • [[:File:Foo.jpg|source=...]] should link to (rather than display) local or commons files as specified.

This would allow for the (preemptive) avoidance of name collisions in situations where this is desirable. In theory it could also allow for multiple file repositories (but that is not the core purpose of this task).

See also discussion at T250632 (which is about a different way to resolve issues with file name collisions)