I am trying to randomise a digest once it is sorted by date so I don't get the same first few feeds coming from the same source. For example, Sources A, B and C have feeds but A and B both have feeds published today. Currently, all today's feeds from A appear first before today's feeds from B. What I want is to randomise the feeds so I can get something like A, B, A, B.....Is that possible.
Forums
Feed Informer Support
Possibility to "Sort by Date" and randomise
3 posts-
Posted 9 years ago #
-
Although Feed Informer doesn't have such mechanics built in, this still can be done using not overly complicated client-side Javascript code.
You can try something like this: if your widget is intended to display, for example, 5 items, change the number of items to display to 20, but set the 'display' CSS property of each item to 'none' (by 'item' we understand an HTML tag containing a repeating element of a widget, usually it's <li>). Then, using JS, randomly select 5 items from the list and unhide them.
To prevent displaying the longer version of the widget you should hide at first a container HTML tag (usually <ul>) too. Unhide it once you are done with your manipulations with items visibility.
You can find an example of using JS code with an FI widget here:
http://feed.informer.com/blog/widgets-how-to-display-single-random-item-using-javascript/Posted 9 years ago # -
Here you can find a working example of this technique:
http://feed.informer.com/share/JSUCRIFZKEPlease click on 'CUSTOMIZE', then 'Edit template manually' to grab the code.
Posted 9 years ago #
Topic Closed
This topic has been closed to new replies.