It would be useful if you could customize the alt attribute of button image.

I am including a patch which:
1. Adds a setting for image alt attribute
2. Creates a new "Button" fieldset including Image selector and Alt text.

Comments

piggito created an issue. See original summary.

piggito’s picture

StatusFileSize
new3.41 KB

Please check the patch i submitted

piggito’s picture

andypost’s picture

Status: Active » Needs review
andypost’s picture

+++ b/printfriendly.module
@@ -100,14 +100,15 @@ function printfriendly_node_view(array &$build, NodeInterface $node, EntityViewD
        '#type' => 'link',
-       '#markup' => Markup::create('<a href="http://www.printfriendly.com/print?url='.$full_path.'" class="printfriendly" onclick="window.print(); return false;" title="Printer Friendly and PDF"><img src="' . file_create_url($image) . '" alt="Printer Friendly and PDF" /></a>'),
+       '#markup' => Markup::create('<a href="http://www.printfriendly.com/print?url='.$full_path.'" class="printfriendly" onclick="window.print(); return false;" title="Printer Friendly and PDF"><img src="' . file_create_url($image) . '" alt="'.$image_alt.'" /></a>'),
...
      return array(
-       '#markup' => Markup::create('<a href="http://www.printfriendly.com/print?url='.$full_path.'" class="printfriendly" title="Printer Friendly and PDF"><img src="' . file_create_url($image) . '" alt="Printer Friendly and PDF" /></a>'),
+       '#markup' => Markup::create('<a href="http://www.printfriendly.com/print?url='.$full_path.'" class="printfriendly" title="Printer Friendly and PDF"><img src="' . file_create_url($image) . '" alt="'.$image_alt.'" /></a>'),

I think both should be a type=link and this mess with #markup should not be involved

fabsgugu’s picture

Status: Needs review » Closed (outdated)