indieweb / wiki

Wiki backup and issue tracking for indieweb.org
https://indieweb.org/wiki/
The Unlicense
23 stars 8 forks source link

Alt text not appearing using photosrcalt template #37

Closed chrisaldrich closed 7 years ago

chrisaldrich commented 7 years ago

I'll try to come back to this myself in a bit, but if anyone has a "quick" fix...

It appears that the https://indieweb.org/Template:photosrcalt template isn't dispalying alt text as one would expect. I've attempted to tweak the #if statement to get the alt text to display, but apparently there are is a bug/issue with "=" appearing within them (this could also be a problem with the src parameter if the URL includes an equal sign as well, as they often can eg: http://example.com/?p=1)

It appears that instead of using anonymous parameters, we ought to use numbered or possibly named (src & alt perhaps?) parameters. Not being a wiki expert, will changing them to numbered or named break all of the current pages using the template, or if unspecified will they use the default order convention within the new numbered/named set up?

I've also tried templating the = or using on it, neither of which seems to work.

As it stands the current template seems to work, but just won't display the alt text properly.

See also: https://www.mediawiki.org/wiki/Help:Templates for details on anonymous, numbered, named parameters https://phabricator.wikimedia.org/T16235 for problem with = appearing in parameters https://en.wikipedia.org/wiki/Help:Template#Usage_hints_and_workarounds

gRegorLove commented 7 years ago

@chrisaldrich Which page(s) is this not working on? At a glance, it seems to be working on https://indieweb.org/events/2016-06-29-homebrew-website-club

chrisaldrich commented 7 years ago

Perhaps it was a cache issue as I was running out of the office this morning? I see it working on my laptop presently. Thanks @gRegorLove for keeping me sane.

I'll mark as closed, though I'll come back to test the other spurious issue in URLs from home.

gRegorLove commented 7 years ago

Re-reading and testing, I did find that without explicit 1= and 2= before the parameters, equal signs cause problems. I updated the documentation so the example uses them and explained why they're recommended.