Hello,

Is there a way to expose the instagram caption as ALT text.
It's a requirement for an accessible website.

Thanks.

Alex

Comments

yanniboi’s picture

Status: Active » Closed (works as designed)

Yes, you can edit provide your own template file.

Copy the instagram-block-image.tpl.php file to your themes templates directory and modify the markup to your desire.

More information https://www.drupal.org/node/341628

alexvgtb’s picture

Thanks Yanniboi! I did edit the instagram-block-image.tpl.php like this:

<a class="group" target="blank_" rel="group1" href="<?php print $href ?>">
  <img style="float: left; margin: 0 5px 5px 0px; width: <?php print $width ?>px; height: <?php print $height ?>px;" src="<?php print $src ?>" alt="<?php print $caption ?>">
</a>

However it looks like the caption is not an available variable. Did I miss something? Thanks.

Alex

yanniboi’s picture

I provide the $post variable which includes EVERYTHING that instagram gives you in a request. To find the caption, enable the devel module (https://www.drupal.org/project/devel) and type

<?php
dpm($post);
?>

in the template file.

You can then navigate the $data variable to find the caption.

yanniboi’s picture

I think what you are looking for is:

$post->caption->text

miwayha’s picture

This is a pretty simple module. It would be nice for it to be accessible out of the box so that it could be used by site builders who don't have coding skills.

I'll work on a patch for this for it to be accessible out of the box.

mgifford’s picture

Issue tags: -accesibility +Accessibility
mgifford’s picture

yanniboi’s picture

Status: Closed (works as designed) » Needs work
vuil’s picture

Status: Needs work » Closed (works as designed)