Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Random Content Slider View modes: 
User avatar
Member
Member
rodm-montcalm - 1/19/2011 9:51:43 AM
   
Random Content Slider
Is there a way to make the content slider pull documents in a random order?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 1/20/2011 3:50:11 AM
   
RE:Random Content Slider
Hello,

The default content slider webpart just auto-rotates the images in the same order. If you want to randomize it, you will need to modify the webpart's javascript. It is the "ContentSlider.js" file which can be found in the ~CMSWebParts\Viewers\ContentSlider_files\ folder. You'll need to modify the autoTurnPage function. Basically you need to generate a random number in the range up to used images count and check if it's not the same as the current image (page).

Best regards,
Boris Pocatko

User avatar
Member
Member
Ren - 9/19/2012 7:22:20 PM
   
RE:Random Content Slider
Hi,

I have made the change in ContentSlider.js and it works ok for the second image onwards.

However, the first image is always the same.

Where should I change to randomise the first image too? I.e. for the first image to be any of the pack?

Thanks

User avatar
Member
Member
Ren - 9/20/2012 4:10:18 AM
   
RE:Random Content Slider
I have disabled all caching on the website (removed all image, content and local caching i.e. putting '0' on all of them'), but this did not resolve the problem.

I am using Kentico 6.0 hotfix 23 and Internet Explorer 8.

Interesting, it gives me the right result when I am editing the website, but not when I run the live site.

Thanks,
Renato

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/20/2012 4:40:23 AM
   
RE:Random Content Slider
Hi,

could you please confirm that you set property Cache minutes to 0? It is not Partial cache setting. You can find it in the System settings section.

Before testing behavior, please restart application and open it in a new browser.

Thank you for confirmation.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Ren - 9/28/2012 1:26:47 AM
   
RE:Random Content Slider
Thansks,

Problem solved with your suggestion.

Cheers