Jump to content

Pip

Members
  • Posts

    77
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Pip's Achievements

Full Member

Full Member (4/6)

11

Reputation

  1. I misunderstood the documentation! Got it working now. Thanks a ton!
  2. Hi everyone! Prolly this is the most noobest question. But how do you work on date times in Processwire templates? I've been working on one that will check if it's the current day and not over a certain time. PHP wise it's easy. But on a Processwire template, it spits out as an error. $wholedatetime = DateTime("now", new DateTimeZone('Asia/Singapore') ); $currentdate = $wholedatetime->format('Y/m/d'); $currenttime = $wholedatetime->format('H'); echo $page->batchdate; if ($currentdate != $page->batchdate) { if ($currenttime < 23) { $formflag = 2; } } Help!
  3. It depends on how you use it. $ingredient is just a name.
  4. Found another work around and removed it! Couldn't delete the post. But admin if you're seeing this, please delete any proof of my noobness.
  5. Hi guys, Testing out to create a new page from HTML. First one sucked because I used "&" rather than "." to join strings. Now I'm stuck with a blank page which I can't edit or deleted. :( Literally when I mouse over, nothing comes up. Help! OCD brain not working. Thanks in advance!
  6. Pip

    Phantom field

    ..... now it's working. I think your response scared the bogey away, @elabx
  7. Pip

    Phantom field

    @elabx bet it got you excited. Don't think it's a typo. Especially if you do a print_r($batch); <?php // Check if today is in a batch $batches = $pages->find("template=batch, batchdatestart<=today, batchdateend>=today"); foreach ( $batches as $batch): print_r($batch); ?> And this is the output (now): Here's a screenshot of the template now (not touching it now I swear!!)
  8. Hi all. I think I am being punked. I created a template called "batch" where I have "slotstotal" which is integer/text to store the value. Oddly, I have entered a value in on a page using the batch template via the PW admin. But when I do a print_r, I got this. I thought the field is bugged so recreated it with a different field name. Now when I refresh the page, I still got the same screen. (I tried changing the page a bit and it does reflect but the print_r is still the same. 😞
  9. Let me face palm for a sec. LOL It works. So I needed to foreach another time so weird. Thank you so much!
  10. Debug is now on. Thanks on the efficiency. Implemented it. As for print_r, I got these.
  11. Hi Everyone Need some help on page reference (PR) field type in repeaters. I've checked other threads and it seems straightforward by referring to the object name and down to "title", "name" etc. I tried it on my side and it seems "title" and "name" and "id" of the PR is blank. But if I refer to the object itself, the page ID is given no problem. Problem is when I try to query the page (ingredient template) using $pages->find, it returns none as well. I did strval none (yes was that annoyed). Some background: What I am trying to do: I am trying to create an online order form for a pizza place where menu rotates and comes in batches. In the order form (page), it will check if today is in any batch. If yes, it will display all items in the menu BUT provided they have the available ingredients (ingredient->quantity > 0). My problem: I can't query the page which is weird and I need to check if there's still some stocks. 😞 See codes below. <?php // Check if today is in a batch foreach ($pages->find("template=batch, batchdatestart<=today, batchdateend>=today") as $batch): ?> <br> Title: <?php echo $batch->name; ?><br> <?php // Print pizzas available today foreach ($batch->menu as $menuitem): echo $menuitem->title . "<br>&nbsp; &nbsp; &nbsp; Ingredient: <br>"; // Print ingredients of this pizza foreach ($menuitem->topping as $pizza): // The problematic line belo. // If $pizza->ingredient->title/name/id, none appears. // If $pizza->ingredient, page ID appears BUT if you use in the $pages->find, it returns none. echo $pizza->ingredient . "<br>"; endforeach; endforeach; ?> <?php endforeach; ?>
  12. Hi everyone, Is there a way to funnel data from a Google Sheet to a Processwire page? Thanks.
  13. Hi @MoritzLost Tried your recommendation. You're right the hero-ability.php was non existing. Recreated it and is now linking automatically! Thanks so much! Happy Holidays!
  14. Hi @MoritzLost Thanks for making the module. It's really handy for sites that have majorly a lot of pages. I'm working on a game site where there are heroes and their special abilities, items, etc. . Was totally delighted that it was working on my test environment but I noticed that (sorry if it feels snobbish but itemizing helps me think lol) hyperlinking only works on the Body textarea it only works on one page template so it seems I have two templates - hero and hero-ability. They're both in the module settings. I've also counter checked that my textarea fields have the same settings as the Body textarea. Did I do something wrong? Or did I misunderstand something? Thanks.
  15. Is there a way to import pages with the parent in the CSV?
×
×
  • Create New...