Page 1 of 1

Auto-recognize additional images

Posted: Mon May 05, 2008 7:18 am
by jmestep
I've got a client who want to upload his additional product images into a certain folder, then have Able recognize them. I had thought of investigating a couple of ways of doing that and wanted to see if anyone had looked into it yet.
Name the images according to a pattern, like SKU_B1.jpg, SKU_B2.jpg.
Then
1. Try to institute code for Able to look for those automatically in that folder according to the naming pattern and insert that data into the additional image fields in the database.
2. Try to code the additional image display to run down the folder and look for the images, display them.
Any thoughts? I think adding them to the database would help site performance so the data would be there when the page is browsed.

Any thoughts?

Re: Auto-recognize additional images

Posted: Mon May 05, 2008 1:45 pm
by nickc
Thoughts:
- Add a user group or role for "Image Editor" and assign it to your client
- Build (or integrate the existing) file upload control directly into the store product detail page
- Toggle visiblility of the control based on Token.Instance.User.IsInGroup(intGroupId) - maybe a button that reveals a panel?

That way, your client just visits the product page for the product they wish to update, clicks the "Add Image" button and uploads. Looks like the existing page (Admin/Products/Assets/UploadAdditionalImage.aspx?ProductId=x) would be relatively easy to co-opt/convert to ascx and has the added advantage in that file naming convention won't matter - the image is bound to the item via the called product id, and is inserted in the database (ac_ProductImages)

-Nick

Re: Auto-recognize additional images

Posted: Mon May 05, 2008 4:34 pm
by jmestep
Thanks for this info. I think some of the things would be good if we put them on the main edit product page, but everyone probably has different preferences.
In this case, the client doesn't want to do anything but upload the image via ftp- he doesn't want to go to the product page, even if the additional image control didn't require another click to get to it.

Re: Auto-recognize additional images

Posted: Tue May 06, 2008 11:09 am
by nickc
Hmm.
If you bypass the site to load images, you'll have to resort to some "after the fact" processing, capturing/reviewing feedback etc., in addition to losing easy access to CommerceBuilder methods.

Why not have the client save all images in a zip file, inside folders named as ProductId values? They could then upload that zip file directly to the site and bypass ftp completely, allowing you to recursively process those images with easy access to ProductId, and Product, ProductImage, FileHelper classes. The provided image filenames wouldn't even matter - you could easily build new names based using Sku_(select count(ProductId)+1 from ac_ProductImages)...

-Nick

Re: Auto-recognize additional images

Posted: Tue May 06, 2008 12:37 pm
by jmestep
Nick, I will look into that. Thanks for the suggestions.