Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Pass Image Array to jQuery Plugin View modes: 
User avatar
Member
Member
ekeys-access - 7/7/2012 10:35:36 PM
   
Pass Image Array to jQuery Plugin
I trying to convert a jQuery background image plugin into a web part so that editors can choose images, options, etc.

I need to pass an array of selected images to the plugin's initiation function. What would be a good way to do this? Can I do this with a transformation?

I know I can build the list of images with a transformation and put them in a <ul> list on the page, but, due to the size of the images, it would greatly affect the page load time. Instead, the plugin I'm using does a good job of loading optimization, so it would be ideal if I could just pass an array of user defined images to the plugin.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/10/2012 5:55:18 AM
   
RE:Pass Image Array to jQuery Plugin
Hello,

You can use our API to retrieve the images from the system. It depends, in what format the images should be and where are they saved in the system. As usually, file system based storage with direct links is faster, then database retrieval, because of the IIS caching, which is applied to those.

Best regards,
Boris Pocatko

User avatar
Member
Member
ekeys-access - 7/10/2012 6:59:00 AM
   
RE:Pass Image Array to jQuery Plugin
They are jpg images and I was going to store them in the file based system as you said. Here is the plugin I am using. Could you possible point me in the right direction for passing the array through the API?

Thanks for your help

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/16/2012 7:30:32 AM
   
RE:Pass Image Array to jQuery Plugin
Hello,

I'am not sure where and how you would like to display the images. However, you need to get as far as I know the links to those images. The generated link format depends on how you are saving the files. If in a media library, then you can use direct links. Please let me know, what approach you would like to use, since different approaches generate different links. Afterwards can the code be generated via a custom web part, which is I think the best approach in this case.

Best regards,
Boris Pocatko