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
-
Originally 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>
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
-
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