Jump to content

chumneypwire

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by chumneypwire

  1. I was just wondering if perhaps anyone has had this issue before. I am pulling in some emails for a system (all the emails are in tables etc), but some of my emails are getting cut off half way through. For example, the original email has an image with text to the right of it, but in my body field, the code is cut off right after the image and does not pull in the rest of the email. I body field set to not maximum, but for the life of me I can not figure out the issue. Any help would be appreciated.
  2. 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?
  3. 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?
  4. 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 }
  5. 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?
  6. @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.
  7. 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.
  8. 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).
×
×
  • Create New...