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

Display all web app items in random order

Participant ,
Aug 07, 2012 Aug 07, 2012

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?

TOPICS
Web apps

Views

2.8K

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 , Aug 27, 2012 Aug 27, 2012

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.

Votes

Translate

Translate
Adobe Employee ,
Aug 07, 2012 Aug 07, 2012

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

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
Participant ,
Aug 07, 2012 Aug 07, 2012

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?

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
Adobe Employee ,
Aug 27, 2012 Aug 27, 2012

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

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
LEGEND ,
Aug 27, 2012 Aug 27, 2012

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.

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
Participant ,
Feb 06, 2013 Feb 06, 2013

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

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
Participant ,
Feb 07, 2013 Feb 07, 2013

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>

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 ,
May 21, 2013 May 21, 2013

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

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
Explorer ,
Feb 13, 2017 Feb 13, 2017

Copy link to clipboard

Copied

LATEST

I know this is an old thread but I just tried your method, KenTPT, and it seems to work well.

So 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
Explorer ,
Jul 25, 2016 Jul 25, 2016

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

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