indieweb / micropub-extensions

Issue tracking for Micropub extensions
https://indieweb.org/Micropub-extensions
10 stars 0 forks source link

Allow posting 'Alt' on photos #9

Open swentel opened 5 years ago

swentel commented 5 years ago

I'm currently experimenting with Drupal and Indigenous for Android to allow setting an alt for one or more uploaded photos. Important, not through the media endpoint or JSON post, so simply in a multipart form-data post.

The Drupal IndieWeb micropub extension looks for a property in the post array called 'photo_alt'. It's an array of strings. If you upload 3 photos (in $_FILES), you can pass an array into photo_alt to set the alt for that image, based on the index. index 0 is for file 0 etc.

$post = [
  'name' => 'An article with 3 photos',
  'content' => 'And every photo has an alt',
  'photo_alt' => [
    'photo 1', 'photo 2', 'photo 3',
  ],
];

This is currently available in Drupal (see https://github.com/swentel/indieweb/issues/380). The next Indigenous release will allow this to set it in the UI (see https://github.com/swentel/indigenous-android/issues/197).

manton commented 5 years ago

This was discussed in the chat, and I think is somewhere on the wiki: the consensus was a parameter "mp-photo-alt" to match every "photo" parameter. Micro.blog supports this across all its apps.

swentel commented 5 years ago

@manton oh cool, makes sense too. I've updated that in the Drupal module, and also in Indigenous.

Note: do you have an idea if Indigenous for Android works with micro.blog ? :)

manton commented 5 years ago

Indigenous for iOS works with Micro.blog so I'm guessing the Android version works too, but I haven't tested it myself yet.