Announcement

Collapse
No announcement yet.

Read an image

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

  • Strat1979
    replied
    Thanks Nick. Perfect

    Leave a comment:


  • Nick
    replied
    If you are on the PROD template you will be able to access the main image using this variable
    Code:
    l.settings:product:customfield_values:productimagecustomfields:main
    if you have the Main image type selected in the custom fields settings of the Product Display Layout:

    imagetype.JPG
    Attached Files

    Leave a comment:


  • Strat1979
    replied
    Yes, it is on the prod page

    Leave a comment:


  • Brennan
    replied
    Where is that code being used? If this is on the product page, there is definitely an easier/better way.

    That code is loading the main image type then loading the image for the product of type main. But all that data is already available for you if on the Product page,

    Leave a comment:


  • Strat1979
    started a topic Read an image

    Read an image

    Currently I am using this code to test a product for an image:

    <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, l.settings:imagetype:id, 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:if expr="NOT ISNULL l.settings:imagedata:image">


    Is there a more streamlined code that can be used for this purpose?
Working...
X