Page MenuHomePhabricator

TemplateData presentation in fields with many aliases
Open, LowPublic

Description

In some of the citation templates on en-wikipedia some fields have a great many parameters. For example cite-book has

	"last": {
			"label": "Last name",
			"description": "The surname of the author; don't wikilink, use 'authorlink'; can suffix with a numeral to add additional authors",
			"aliases": [
				"last1",
				"author",
				"author1",
				"author1-last",
				"author-last",
				"surname1",
				"author-last1",
				"subject1",
				"surname",
				"author-last",
				"subject"
			],
			"suggested": true,
			"type": "string"
	},
	"work": {
			"label": "Work",
			"description": "Name of the work in which the cited book text is found",
			"type": "string",
			"aliases": [
				"journal",
				"website",
				"newspaper",
				"magazine",
				"encyclopedia",
				"encyclopaedia",
				"dictionary",
				"mailinglist"
		]

Problems occur when the documentation page is viewed. In https://en.wikipedia.org/wiki/Template:Cite_book/doc the width of the parameters column is very wide making the table overflow the page width. This problems as been raised at https://en.wikipedia.org/wiki/Help_talk:Citation_Style_1#Please_fix_the_Template:Cite_book.2Fdoc_for_us.3F

Here's a screenshot where the actual parameter name cannot even be seen while editing the TemplateData. Note the parameter between "Original year" and "Editor first name":

Screenshot 2021-07-05 at 11-35-46 Editing Template Cite encyclopedia doc - Wikipedia.png (1×1 px, 182 KB)

This might be cured with an appropriate bit of css.

A bigger problem is how these appear from within VisualEditor. We can see the list of aliases overflow the space in the citation dialog.

cite book screenshot.png (466×687 px, 106 KB)

Event Timeline

It seems like this particular problem would be resolved by displaying the aliases vertically in a list, rather than concatenating them horizontally. I do not know if that would have negative side effects somewhere else, however.

I don't know why the alias list apparently makes the table overflow the page, since the list wraps just fine, sometimes even in the middle of an alias name.

I would guess it would be just as easy for each of the code blocks to have a space between each of them; the HTML presently generated is <code>X</code><code>Y</code><code>Z</code> whereas it should probably be <code>X</code> <code>Y</code> <code>Z</code>. That would probably be enough.

For wrapping, the browser probably can't find a good line break spot so it takes the - present in most parameter names.

Deskana moved this task from To Triage to Freezer on the VisualEditor board.