Page MenuHomePhabricator

Default value for parameter in transferred templates
Open, LowPublic

Description

I have been looking at adding to https://www.mediawiki.org/wiki/Extension:FileImporter/Data/en.wikipedia to have the tool transfer from :en:Template:PD-user to :commons:PD-user-w. The PD-user template on enwiki has a third parameter that defaults to "en" if not specified. However, I couldn't find any way to define that in the configuration file. If I entered the following, no value would be transferred for language in most cases:

;PD-user:PD-user-w|+project=w|language=2|user=1

What's needed is a syntax that the tool would interpret it as "set language= to the value of 2=, but if 2= is not defined, set language= to <code>en</code>". Something like a=source_parameter|+a=fallback value :

;PD-user:PD-user-w|+project=w|language=2|+language=en|user=1