Page MenuHomePhabricator

paramOrder in TemplateData does not work for unnamed template parameters in VisualEditor
Closed, ResolvedPublic

Description

I have a template at Wikipedia with both named and unnamed parameters. I want the unnamed params to be shown AFTER the names parameters so I used paramOrder in TemplateData to sort the parameters and put the unnamed in the end. When I use the visual template editor (in both "visual editing" and "source editing" modes) the unnamed parameters are ALWAYS at the top of parameter list (no matter of paramOrder values). Expected behavior is for the unnamed params to be at the bottom (respecting paramOrder definition).

Here is example of TemplateData code that I used. I want the paremeters 1, 2, 3 and 4 be at the almost end of list. The full source code in this template revision.

<templatedata>
{
	"description": "Vylepšená obrázková galerie, která dovede dohledat jméno souboru podle názvu článku z projektu Wikidata.",
	"params": {
		"jméno1": {
			"label": "Jméno 1",
			"description": "Název článku nebo jméno souboru",
			"example": "Vltava nebo Vltava.jpg",
			"type": "string"
		},
		"popis1": {
			"label": "Popis 1",
			"description": "Popis obrázku (nepovinný)",
			"example": "Řeka Vltava",
			"type": "string"
		},
		"jméno2": {
			"label": "Jméno 2",
			"description": "Název článku nebo jméno souboru",
			"example": "Vltava nebo Vltava.jpg",
			"type": "string"
		},
		"popis2": {
			"label": "Popis 2",
			"description": "Popis obrázku (nepovinný)",
			"example": "Řeka Vltava",
			"type": "string"
		},
		"1": {
			"label": "Jméno 1 (jednoduchý zápis)",
			"description": "Název článku nebo jméno souboru",
			"example": "Vltava nebo Vltava.jpg",
			"type": "string"
		},
		"2": {
			"label": "Popis 1 (jednoduchý zápis)",
			"description": "Popis obrázku (nepovinný)",
			"example": "Řeka Vltava",
			"type": "string"
		},
		"3": {
			"label": "Jméno 2 (jednoduchý zápis)",
			"description": "Název článku nebo jméno souboru",
			"example": "Vltava nebo Vltava.jpg",
			"type": "string"
		},
		"4": {
			"label": "Popis 2 (jednoduchý zápis)",
			"description": "Popis obrázku (nepovinný)",
			"example": "Řeka Vltava",
			"type": "string"
		},
		"mode": {
			"type": "string"
		},
		"heights": {
			"type": "number"
		}
	},
	"paramOrder": [
		"jméno1",
		"popis1",
		"jméno2",
		"popis2",
		"1",
		"2",
		"3",
		"4",
		"mode",
		"heights"
	],
	"format": "block"
}
</templatedata>