Announcement
				
					Collapse
				
			
		
	
		
			
				No announcement yet.
				
			
				
	
Conditional to check for socialImage
				
					Collapse
				
			
		
	X
- 
	
		
		
		
		
		
	
	
	
	
 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.
 
- 
	
		
		
		
		
		
	
	
	
	
 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
 
 
 Leave a 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/etc
 Leave a comment:
- 
	
		
		
		
		
		
	
	
	
	
 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" />
 
 
 Leave a comment:
- 
	
		
		
		
		
		
	
	
	
	
 Why not do this:
 
 Code:<mvt:if expr="NOT ISNULL g.socialimage"> <img src="&mvte:global:socialimage;" alt="my awesome product"? </mvt:if> 
 Leave a comment:
- 
	
		
		
			
			
			
		
		
		
		
	
	
	
	
 Conditional to check for socialImageStore 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?
 
 Tags: None
 
Leave a comment: