Copy link to clipboard
Copied
I see that it is possible to display one random web app item, what about all web app items in a random order?
Your loading a lot of content though that way which you don't want to do and can be indexed by search engines when you don't want it. It will appear as consistent all items and not random fresh content.
While not great for search engines you can have a page of all the web apps and using counter tag in the elements for each you can make that hidden from search engines. You then run through these with say jQuery to pick a set of random ones and Ajax in to where you want them.
Copy link to clipboard
Copied
Hi,
Unfortunately as you've noted the random item will only appear as one as we do not have a parameter to allow for multiple random items to display at once.
We're limited to the module parameters and options below at this stage.
- http://kb.worldsecuresystems.com/134/bc_1345.html#main_Web_App_Modules
Kind regards,
-Sidney
Copy link to clipboard
Copied
I can think of many web app scenarios which could benefit from a randomized order to an entire list. Is this in the works?
Also, has anyone come up with a work around?
Copy link to clipboard
Copied
How about something like this:
-render the webapp items in a hidden div
-loop all of the items in the list and put them(their HTML code) into an array
-assume the array has 52 items, generate a random number between 1 - 52, extract that item from the array and place it in the DOM M in its "final"position
-repeat the step above until the array is empty and all the elements have been moved
Now you should have a random webapp listing. Let me know how this works for you.
Later edit - here is a thread on how to build the array - http://forums.adobe.com/thread/1045330?tstart=0
Copy link to clipboard
Copied
Your loading a lot of content though that way which you don't want to do and can be indexed by search engines when you don't want it. It will appear as consistent all items and not random fresh content.
While not great for search engines you can have a page of all the web apps and using counter tag in the elements for each you can make that hidden from search engines. You then run through these with say jQuery to pick a set of random ones and Ajax in to where you want them.
Copy link to clipboard
Copied
Is there a tutorial or new functions by chance that allows for randome output of webapp lists? Working on a webapp for a client and this is needed/required.
Tom
Copy link to clipboard
Copied
<div style="display: none;" id="alldata">
{module_webapps,16282,a,,,,,,,3,}
</div>
<p>
<script type="text/javascript">
var tmpContent = alldata.innerHTML;
var tmpArray = tmpContent.split("<td>");
tmpArray = tmpArray.filter(function(e){return e});
var tmpReturn = 1;
document.write("<table width=100%>");
tmpArray.sort(function() { return Math.floor(Math.random()*3 -1)});
for (var i=1;i<(tmpArray.length-1);i++) {
if (tmpArray.indexOf("<br") != -1) {
if (tmpReturn == 1) {
document.write("<tr height=200><td>");
}
document.write(tmpArray.replace("</td>","").replace("</tr>", "").replace("<tr>", "").replace("</tbody></table>",""));
if (tmpReturn == 3) {
document.write("</td></tr>");
tmpReturn = 0;
} else {
document.write("</td><td>");
}
tmpReturn++;
}
}
document.write("</table>");
</script>
</p>
Copy link to clipboard
Copied
We use the jQuery script at the following link for our random ordered webapp lists:
http://css-tricks.com/snippets/jquery/shuffle-dom-elements/
Just apply an id to the ul and tweek the function call to match, works well for randomising an unordered list before applying a jQuery carousel or slide show.
Regards
Ken
Copy link to clipboard
Copied
I know this is an old thread but I just tried your method, KenTPT, and it seems to work well.
So thanks!
Copy link to clipboard
Copied
With liquid, this can now be done pretty easily. We created widget for this to make it very plug and play. We created a tutorial for this over at the BC Academe: Randomize Multiple Web App Items | Adobe Business Catalyst Training | BC Academe