2

I would like to use a parameter like orderby="random" on a matrix field to randomize the order of the row output.

{matrix_field orderby="random"}
  {row_title}
{/matrix_field}

I tried this, but got a MySQL error. Is this possible?

3
  • What type of mysql error did you get? May 21, 2013 at 21:50
  • Without testing I'm quite sure this is correct. What error are you getting? May 21, 2013 at 21:51
  • MySQL error was Unknown column 'random' in 'order clause' because you can't set random via the orderby parameter. The answer below is correct!
    – Jon Horton
    May 22, 2013 at 13:11

1 Answer 1

8

You actually have to do sort="random" in Matrix. It's not like channel:entries in that way.

2
  • I just looked it up a minute ago and could have sworn I saw it under orderby as well as sort. Either the docs just changed or I'm seeing double: voting for the latter. May 21, 2013 at 22:17
  • Yeah, the old docs used to have all this info and more, but the new ones are sorely lacking :( Thanks for the help!
    – Jon Horton
    May 22, 2013 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.