Store has some products that don't have images (yet) so the &mvt:global:socialImage; is producing a link that causes a 404 error https://www.domain.com/mm5/ - is there a way to test/check to see if the image is available?
Announcement
Collapse
No announcement yet.
Conditional to check for socialImage
Collapse
X
-
Conditional to check for socialImage
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Tags: None
-
Thank but it's still showing a broken link but I may see whyOriginally posted by Scot - ScotsScripts.com View PostWhy not do this:
Code:<mvt:if expr="NOT ISNULL g.socialimage"> <img src="&mvte:global:socialimage;" alt="my awesome product"? </mvt:if>
Maybe I need to be checking to see if there is a "main" image?Code:<mvt:do file="g.Module_Library_DB" name="l.success" value="ImageType_Load_Code('main', l.settings:imagetype)" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:i d, 1, l.settings:imagetype)" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id , l.settings:imagedata)" /> <mvt:assign name="g.socialImage" value="g.baseurl $ l.settings:imagedata:image" />
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
yes, use
l.settings:imagedata:image
in the mvt:if statement.
g.socialimage will always be true
btw: don't know if i'd rely on g.baseurl all the time. i've seen some sites not have that always available. instead use https://&mvt:domain:name;/mm5/etcBruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
I got it figured out. Now I'm not sure how happy Google is going to be but I've told the store owner he needs to get images with these products.Originally posted by Bruce - PhosphorMedia View Postyes, use
l.settings:imagedata:image
in the mvt:if statement.
g.socialimage will always be true
btw: don't know if i'd rely on g.baseurl all the time. i've seen some sites not have that always available. instead use https://&mvt:domain:name;/mm5/etc
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Hmmm...don't know if this will make google 'happier', but maybe do an elseif and use say the company logo when a product image is not found.Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
Comment