Talk:Gallery:Landmarks

From GodWiki
Jump to: navigation, search

Newly discovered:

Triffids' Valley Lake of Maidens' Tears Blood-curdling Stream Close Encounters of the Third Kind Hill Brokeback Knoll Cliff of the Lonely Hero Meadows of Eternal Tranquility

Update & removal of alt texts

I updated this page, replacing a bunch of Gray.jpg placeholders with the images that have been added to the appropriate location's page.

I also removed all of the alt texts for the images, as they were causing more problems than they were solving. Hopefully screen readers and assistive devices will be advanced enough to use the caption text (which is also set as the title parameter of the enclosing link) to describe the image. If not, and people think the alt arguments are important, they can be added back as long as they're coded correctly (see following example). It has to be done very carefully, and maintenance is a nightmare.

Here's the issue: the Template:Gallery code used on this page has a very serious limitation when it comes to alt arguments. Because they're named parameters (they take the form |name=value), the name of each has to be unique. You can't have multiple parameters all named simply alt. The template solves this by requiring that the parameters be numbered, as alt1, alt2, etc. Which means that the alt parameters will be attached to images not based on their position in the template arguments, the way the images and captions are, but rather according to their numbering.

So, for example, the page code previously contained:

{{Gallery

|title=[[Godville]] ~ [[Beerburgh]]<br>[[Image:Godville.jpg|150px|Godville]] ~ [[Image:Bb.jpg|150px|Beerburgh]]
|width=250
|align=center

| Image:Pond.jpg|alt=Little-Big Pond|[[Little-big pond]].
| Image:Mainstreamhead.jpg|[[Mainstream]]
| Image:Prettyaccurate.jpg|[[Wastelands of Insomnia]]
| Image:Btree.JPG|alt1=B-Trees Forest|[[B-Trees Forest]]
}}

As a result of this code, the alt=Little-Big Pond was ignored (as it wasn't of the form altN), the alt text for Pond.jpg (not Btree.JPG) was set to "B-Trees Forest" (because it was the first image), and the other three images had no alt text.

To properly function as intended, the code would've had to have been written as follows:

{{Gallery

|title=[[Godville]] ~ [[Beerburgh]]<br>[[Image:Godville.jpg|150px|Godville]] ~ [[Image:Bb.jpg|150px|Beerburgh]]
|width=250
|align=center

| Image:Pond.jpg|alt1=Little-Big Pond|[[Little-big pond]].
| Image:Mainstreamhead.jpg|[[Mainstream]]
| Image:Prettyaccurate.jpg|[[Wastelands of Insomnia]]
| Image:Btree.JPG|alt4=B-Trees Forest|[[B-Trees Forest]]
}}

But even when written properly, the code is fragile and prone to breaking if alt is used. Whenever the order or number of images changes, the numbering for (potentially all) of the alt params would need to be adjusted accordingly. Insert an image, you have to renumber the alt param on every image that follows.

So, as you can see, when using Template:Gallery it's best to avoid the whole mess if possible. -- FeRDNYC (talk) 11:37, 28 June 2017 (UTC)

Note, BTW, that any page calling the template incorrectly is automatically added to Category:Pages using duplicate arguments in template calls, because mis-specifying the alt= parameters in that manner is an invalid template call. It "looks" fine, to sighted users, but things are still broken behind the scenes. Specifically, the exact things (image alt tags) that people are attempting to make work with the bad parameters! So, it's better to have no alt texts than secretly-broken alt texts. Any page found in that category, or other error-condition categories, needs to be fixed. (Error categories will appear as redlinks in the category listing as long as there are pages on the wiki with the corresponding type of error, even though the category page doesn't exist.) -- FeRDNYC (talk) 11:13, 7 July 2017 (UTC)