Jump to content

Search the Community

Showing results for tags 'random'.

  • Search By Tags

    • random ×
    Type tags separated by commas.
  • Search By Author

Content Type



Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Found 9 results

  1. So I tried using $page->repeater->getRandom() in some template code but it didn't seem to work. Should this work? If not, what is the recommended way of working with a single, randomly-chosen repeater item? Thanks!
  2. $items = $pages->find("template=city, sort=random, limit=20"); I'm using find to get 20 random items, is there a way to use a seed so i can paginate them?
  3. Following the example from the PW docs I set up a a repeater. I'm trying to fetch random fields from a repeater, for instance, display 4 random customer testimonials. Here is the basic setup in PW: created these fields: testimonial_text testimonial_name I then added...
  4. Posting in the hope this helps someone out of a hole! Having built 20+ sites on PW in the last couple of years (and loving it...) I came across a really odd situation recently. The client's IT company and I 've been battling for a couple of weeks and today, finally, we have an answer! The...
  5. Hello, Getting random pages with $oldPosts = wire('pages')->find('template=post, shown=1, limit=100')->findRandom(16); works fairly good. About 500ms But without the limit=100 it takes more than 6 seconds. There are only 60 pages with template post but it will be thousands when the app is l...
  6. Hey Guys! I ran into some really strange behavior when trying to save selected Selectfieldtype values from a form to a select field in a page. I have three different dropdowns in this page, all with different values and they randomly get saved en sometimes they don't. This is my setup: Form...
  7. Hello All! This is my first post here and am a newbie with PW. So far I've been able to accomplish everything I've wanted to do dynamically in my first PW site, but ran into a big snag yesterday. Ok here's the setup: I have on my site 4 pages that deal with separate plumbing services. We offer a...
  8. Hi, I'm trying to combine two find() arrays in a random order but currently can only make it give me back the same order each time. here's what im working with: $works = $pages->find('template=work'); $articles = $pages->find('template=article'); $works->prepend($articles); $randWorks...
  9. Hello, I'm trying to change all upload image files names for the random names. So I put in Pageimage.php this lines: $rand = substr(md5(microtime()),rand(0,26),5); $basename = basename($rand, "." . $this->ext()); // i.e. myfile But as a results I got a lot of random filenames during each pa...
×
×
  • Create New...