Announcement

Collapse
No announcement yet.

Write Main Image URL to Custom Field

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

    Write Main Image URL to Custom Field

    Just can't quite figure this one out ... I need to write the URL of the main image in the image machine to a custom field automatically. Currently, we are having to copy the URL and enter it into the custom field. I'd like for this to be automated. I know you can write to custom fields, but I just can't get it to work. Anyone want to help guide me? Thanks!
    Jason Lindsey
    Dreamchaser Design
    www.dreamchaserdesign.com
    "You Dream. We Design."

    #2
    If you are doing this on the product page, then this should work

    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:id, 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:item name="customfields" param="Write_Product_ID( l.settings:product:id, 'custom_field_code',  l.settings:imagedata:image )" />
    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


      #3
      Thanks! This seems to be working. I couldn't quite get it right. I was trying to do a read/write ... it just wasn't working. Thanks again.
      Jason Lindsey
      Dreamchaser Design
      www.dreamchaserdesign.com
      "You Dream. We Design."

      Comment


        #4
        Originally posted by Bruce - PhosphorMedia View Post
        If you are doing this on the product page, then this should work

        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:id, 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:item name="customfields" param="Write_Product_ID( l.settings:product:id, 'custom_field_code', l.settings:imagedata:image )" />
        Bruce - PhosphorMedia

        Hello, I'm wondering if this can somehow be customized so the url can be seem in admin view. In other words, if I'm looking at a list of subcategories in admin with the following data columns Code, Name, Parent Category, Last Updated - I would like to add a custom field to be the url (or uri) of the subcategory.

        e.g.
        Code Name Parent Category Last Updated Custom Field (URL)
        prod1 Product 1 My Products 03/24/2021 /my-products/prod1.html
        2021-03-24_17-06-57.png
        Of course, I can view the URI by clicking on the tab, but I'm wondering if in the admin a summary view can include a custom field for the uri - automatically populated?
        Last edited by pipette-dave; 03-24-21, 04:08 PM.

        Comment

        Working...
        X