-
- 1 Posts
Hi guys. First off, I'd like to apologize for my poor search skills. I didn't know how to phrase this question in google to see find results (because I know I'm not the firs to ask!) I'm throwing together a website with some hackneyed knowledge of HTML and CSS utilizing modx.
What I'm doing is really generating a single line of text in a Template variable pulled randomly from a subfolder of resources. I am able to make it pick one at random on page load. I have a "reload" button but that really just refreshes the page. I'd love to be able to have my page generate new text on a click of a button.
I'm not very well versed in javascript/php. I've been looking at code so far and modifying it, which lets me learn a little at a time. I really appreciate all of your help!
-
- 5,888 Posts
you can try getResources
[[!getResources?
&parents=`yourContainerID`
&tpl=`@INLINE [[+pagetitle]]`
&sortby=`RAND()`
&outputSeparator=`,`
&limit=`10`
]]
If this words doesn't need to be resources, but just some words, which you want to output randomly, you could try it with a MIGX - TV