- Priority: 0
- Status: Closed
- Theme: Alysum
-
Assigned To:
Fred
- Private: No
- Open Date: 06.05.20, 23:15
- Opened by: Marco Montanari
- Closed by: Anonymous Submitter
- Closed on:
- Reason: Not a bug
Ticket #17714 - AMP validation failed when in alt the text contains the char "
https://gyazo.com/a3e83f529d2b4a16e28f74b717054c6e
All Alt text that contains a " char will broke AMP validation
you can test here: https://search.google.com/test/amp?skip_amp_follow=true&id=GU6ikhVtPYPq_1iEubjbeA
” must be converted in " to not break alt=”something “word” something”
like alt=”something "word" something”
Comments
Fred you know in witch prestashop table is stored the alt text?
other problem with title same problem with the " (double quote) char:
you must use on AMP for alt and title the htmlspecialchars() php function with UTF8 option
https://www.php.net/manual/en/function.htmlspecialchars.php
seems you grab for alt ant title the value from product title and not from product image Caption field.
A good code must be:
but remember to htmlspecialchars UTF8 each text before write on the html
Thank you for sharing the solution, I just added it to the theme. The final code is
have you alerady modified desktop and AMP theme in my installation?
Because if you did is not working :)
https://search.google.com/test/amp?id=KsiLNtobLdOiBp253gSIog
The widged in AMP home page productlist showing not fixed alt and titles