Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
Thread Tools Search this Thread Display Modes
Old February 19th, 2011, 07:54 AM
feri feri is offline
Join Date: Oct 2010
Posts: 74
Default Custom product info/image display problem

I have added custom product images to individual product pages using the model field in the Factory. This is the code in the text module:
<img src="[product.model]" alt="[] available colors"/>​

The problem is, not all my products have extra image, and when there is no such image, many browsers display a missing image icon with bothers me as it does not look good.

I tried to make a custom View in factory, but Product Details Views are for individual products only, so it is not a good solution.

Is there a way to display custom image if exist, and nothing to display if not?
Attached Images
Old February 19th, 2011, 08:23 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
Join Date: Feb 2008
Posts: 16,902

Why didn't you just use the product image or product thumbnail fields? That makes the most sense.

In your case, though, you could use:

<?php if ($product->brand) { ?>
<img src="[product.model]" alt="[] available colors"/>​
<?php } ?>
Old February 19th, 2011, 10:05 AM
feri feri is offline
Join Date: Oct 2010
Posts: 74

Thanks. I did not want to change the stock pictures, I needed to add some and use them together on a page.

As I used the MODEL field, I modified your code a bit and now it works.

<?php if ($product->model) { ?>
<img src="[product.model]" alt="[] available colors"/>​
<?php } ?>

Maybe it would be a good idea to add this IF php code to documentation or as a featured thread, because I think it is useful in many cases, because it basically says: display this particular info if it exists. I am not a php expert, but this one is easy to use anytime anywhere.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display coupons on a product details page from same merchant as the product Eric Tips, Tricks & Tutorials 73 December 9th, 2014 11:06 PM

All times are GMT -5. The time now is 01:09 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.