• Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About chumneypwire

  • Rank
    Jr. Member

Recent Profile Visitors

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

  1. You could easily set up a date/time field and image field (banner_img) and based on the date run/take down the banner in your template. However, are the ads based on "views", or what criteria do the banners have to meet?
  2. chumneypwire

    Thanks Robin, I was going to implement a check for unpublished, but I think I am missing something here: if($page->status != $page->isUnpublished()) { fwrite($myfile, $txt); fclose($myfile); } I did also note that it is writing to the file as well when the page is added to the trash. Is there a way to include this in the if as well?
  3. chumneypwire

    If I remember correctly, "get" only returns one page, and not a page array. I believe you would need to do: $mypages = $page->find('name=foo|bar')->chilren(); foreach($mypages as $mypage) { //some logic }
  4. I was curious, is it possible to exclude the addHookAfter("saved") from running when copying pages. I have a function (currently running in ready.php) that runs on page save for certain templates. $pages->addHookAfter('saved', function($event) { $page = $event->arguments[0]; if($page->template->name == 'dev' .... The function basically just adds the page title to a csv using fwrite if the name does not exist yet. This is functioning great, however, it also runs when copying the pages which produce some unwanted results, ie: dev-page dev-page-1 (the title of the copied page before I have a chance to rename the title and name). I end up with a bunch of *-# pages, as well as the new page names/titles. Is it possible to somehow get around the copying also running the function?
  5. chumneypwire

    @dadish I guess I have one question in regards to actually obtain an output in templates (sorry I am really new to ajax in general). I currently have $result = $modules->get('ProcessGraphQL')->executeGraphQL($query, $variables); in my header of a file, but need to have an "operation" included. I was testing it out with just trying to get the title and body of the current page. I geuss I am a little unsure of how to get started with this.
  6. chumneypwire

    If you go to edit the field in question and go to "Input", you can change the max allowed characters. However, if this is something you didn't edit previously, I don't know how well this will help regarding the 404 error.
  7. chumneypwire

    Thanks @horst, I actually figured out a way, though it might not be the prettiest/best solution. I ended up adding a checkbox into the templates called email_alert_recipients, and doing: if ($today > $post_date && $testing->email_alert_recipients == 0) { $testing->setOutputFormatting(false); $testing->email_alert_recipients = true; $testing->save(); // Email Config Below // ... } Thus far, I have not had any issues with it (fingers crossed).