You are here:  » no image in the feed


no image in the feed

Submitted by MarcoCH on Tue, 2018-11-27 17:01 in

Hello

I have a feed because not all image links work. Is it possible if the image link does not work then an alternative is displayed. (no picture)?

regards
Marco

Submitted by support on Wed, 2018-11-28 09:26

Hello Marco,

Sure - you can use the onerror attribute of an img tag to set a local image URL if the image fails to load.

To do this, first upload a suitable "no image" image as images/noimage.jpg and then for the main product image, edit html/product.php, search for the "img" tag:

<img

...and add the onerror attribute like this:

<img onerror='this.src="/images/noimage.jpg"'

You can add exactly the same to the img in html/featured.php for Featured Products and html/searchresuts.php for search results as required...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Wed, 2018-11-28 16:26

Great, it worked.

Thank you!

Greets
Marco

Submitted by Goodconcepts on Sat, 2021-10-02 20:05

This happens to me in the following two occasions:
1) the URL of the image is exceeding the max length as defined on the fields in the MysQL database. Extending the length in the database solves that issue.
2) more and more sites started implementing Cloudflare recently where trying to pull the image from the website is considered a DDOS attach by Cloudflare. Not sure how to fix that one. Any suggestions?

Submitted by support on Mon, 2021-10-04 09:35

Some networks (e.g. Affiliate Window in the UK) have both merchant and network hosted images so might be worth checking if your feeds support this or similar and always go with the network option.

Otherwise it might be worth contacting the network or merchant where this happens to make sure they are aware of the issue as an image URL contained in a datafeed is
specifically intended to be requested from 3rd party sites...

Cheers,
David.
--
PriceTapestry.com