Search

Not sure if this was answered sufficiently before, but basically I have an unordered list, that just displays 3 generated records. What I want to do is show any 3, if I have 10 records, I want it to show any 3 in a random manner. Is there not a method for doing this?

Just thinking on, this may become more complex, as I may end up with the same advert more than once, when I would want 3 unique ads out of say 10.

Is it possible for this to be automated?

Possible solutions:

  1. Put the all in the source and use JS to randomly hide 7
  2. Use a custom DS to give 3 randomly chosen in the XML
  3. Have a DS provide you with all 10 in the XML, and use XSLT to randomly choose 3

Hmm, the third seems more likely for my skills.

But I believe there is no random function in XSLT.

This thread might be useful:

http://symphony21.com/forum/discussions/202/1/

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details