Announcement

Collapse
No announcement yet.

Conditional to check for socialImage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bruce - PhosphorMedia
    replied
    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.

    Leave a comment:


  • lesliekirk
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    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
    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.

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    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:


  • lesliekirk
    replied
    Originally posted by Scot - ScotsScripts.com View Post
    Why not do this:

    Code:
    <mvt:if expr="NOT ISNULL g.socialimage">
    <img src="&mvte:global:socialimage;" alt="my awesome product"?
    </mvt:if>
    Thank but it's still showing a broken link but I may see why

    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" />
    Maybe I need to be checking to see if there is a "main" image?

    Leave a comment:


  • Scot - ScotsScripts.com
    replied
    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:


  • lesliekirk
    started a topic Conditional to check for socialImage

    Conditional to check for socialImage

    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?

Working...
X