How to display selected pods randomly on page refresh
Hello,
total newbie just getting my head around pods. LOVE IT so far!!!! Have built a site with all content editable for the client with pods. Not figured out the UI bit yet though, tried to install it but apparently it is now bundled with the main pods install so the help sheets I have found no longer apply.
My query is: How to display selected pods randomly on page refresh.
Just wondering if this is possible or not? I have a site and client want random quotes to display in a sidebar on page refresh, I would personally prefer a slider like nivo but could do with knowing what is possible. I have been searching for a few days but not come up with an answer anywhere.
They also want the same thing on another area of the page but this time displaying random images.
They want to be able to edit the content themselves otherwise I would just use nivo slider in the page template. As they want to edit themselves then pods seems like the answer for this too, if this is possible with pods??
I would be VERY grateful if anyone can help me out or point me in the right direction on this.
cheers! :)
4 Answers
Yes. Just use code like this to get a random record:
$pods->new Pod('my_pod');
$pods->findRecords('RAND()', 1);
edited Oct 15 '11 at 2:18
brilliant thanks for the rapid response!! Will have a try now.
hi,
I tried that but I get a fatal error,
Fatal error: Call to undefined method Pod::find_records() in...
this is what i have (no doubt I've missed something simple off?!):
<?php
// Use the "right_quotes" pod $pods = new Pod('right_quotes'); $pods->find_records('RAND()', 1); echo $pods->showTemplate('right_quotes_template');
?>
thanks for the help :)
ah thank you sorted now!!
:)


