• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Work around for adding 'poplet' images to a product

Community Beginner ,
Apr 16, 2014 Apr 16, 2014

Copy link to clipboard

Copied

What I am trying to avoid is manually entering poplet image paths for each product in the online store. I have a PHP solution, but that obviously won't work (no server side coding).

Ideally it would look something like:

Look in folder: {tag_productcode}

Pull all image paths

Insert into <img> tags

Insert into html

I'm probably dreaming here, but does anyone know of a work around to making something like this happen?

TOPICS
How to

Views

280

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 16, 2014 Apr 16, 2014

You can set up a simple naming convention.

You have your large image...

productname-large.jpg

And then another folder which is...

/poplets/

And in there you would have..

productname-poplet1.jpg, productname-poplet2.jpg, productname-poplet3.jpg, productname-poplet4.jpg

You would fetch the path of the large image with javascriptjquery.

You know that -large.jpg is always at the end so you can strip that and store the product name in a variable.

Then you can just run a loop knowing the folder and images will

...

Votes

Translate

Translate
LEGEND ,
Apr 16, 2014 Apr 16, 2014

Copy link to clipboard

Copied

You can set up a simple naming convention.

You have your large image...

productname-large.jpg

And then another folder which is...

/poplets/

And in there you would have..

productname-poplet1.jpg, productname-poplet2.jpg, productname-poplet3.jpg, productname-poplet4.jpg

You would fetch the path of the large image with javascriptjquery.

You know that -large.jpg is always at the end so you can strip that and store the product name in a variable.

Then you can just run a loop knowing the folder and images will have the same flowing structure and pre-pend the product name value and render them out as you need to.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 17, 2014 Apr 17, 2014

Copy link to clipboard

Copied

LATEST

Thanks Liam, this seems like an excellent solution. The one downside is still having to batch rename the images for each product, but the trade-off makes that seem trivial.

I'll give it a shot and post back with any code or increases in efficiency. Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines