The for Google, FB, etc should have alt tags. Can do so via the login-with.html.twig file. The patch takes the last word in the path (Facebook and Google for me) to make an alt tag of 'Social Login Facebook' etc.

CommentFileSizeAuthor
#2 3111718-alt-tags.patch603 bytesbryantt

Comments

bryantt created an issue. See original summary.

bryantt’s picture

StatusFileSize
new603 bytes
bryantt’s picture

Issue summary: View changes
bryantt’s picture

Title: Images in should have alt tags for accessibility » Images in block should have alt tags for accessibility
bryantt’s picture

Issue summary: View changes
wells’s picture

Status: Active » Needs review
gaards’s picture

The proposed patch won't unfortunately work if the /user/ path is overridden, for example when using the Rename Admin Paths module.

Ideally we would have a name attribute/key available in the social_networks variable, then we could access it with social_network.name in Twig. Trying to retrieve the auth provider name through the path isn't an ideal solution, as the Twig part becomes harder to understand and the logic becomes a bit hacky.

Also I think the "Social Login" string proposed in the patch could be replaced with something like:

'Authenticate through @social_network_name'|t({'@social_network_name': social_network.name})

That would also be translatable.

wells’s picture

Thanks for the feedback, @gaards. I'll be pushing a commit using that format. We can get the social network from the @Network declarations easily enough. As a future enhancement, it might be easier to move the route and img_path declarations there as well instead of using SocialAuthController::setLoginButtonSettings on implementer login. But that would require updates from all implementers so something for a a breaking version perhaps.

  • wells committed 8b99d25 on 3.x authored by bryantt
    Issue #3111718 by bryantt, wells, gaards: Images in block should have...
wells’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.