Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
  • Location
    London, UK

Contact Methods

  • Skype

Recent Profile Visitors

2,865 profile views

guy's Achievements

Full Member

Full Member (4/6)




Community Answers

  1. Is there a recommended way to detect when a page is saved via the API vs the admin site within a save hook? Such as: $this->pages->addHookAfter('savedPageOrField', $this, 'someMethod'); within someMethod I'm currently doing the following: $saveBtn = $input->post('submit_save'); if (!$saveBtn) return; // only reach the below when passed a submit_save POST param ... The above seems to work but I wasn't sure if this was a reliable way, or if something more fit for purpose exists?
  2. just updated to v1.1.4 with the bug fix
  3. @ngrmm thanks for letting me know about that config issue. Will get that sorted in a min. On the SendGrid front I'm not too sure. SendGrid should show sent and received stats for all messages, therefore if you're not even seeing that (and the message is delivered) then something else is probably not quite right.
  4. @ngrmm I'm not exactly sure but I have just rolled an update to 1.1.3. I've tested this version and I can see sent and open stats within my admin console: https://app.sendgrid.com/email_activity let me know if this helps.
  5. @teppo thanks pal Yeah I noticed as soon as this was uploaded. Just tweaking it now but as you say no need for the hook as allows it to play better with other WireMail modules.
  6. Github: https://github.com/theGC/WireMailSendGrid What it does: Extend WireMail to bypass PHP mail and send mail via SendGrids Web API. What you need: A SendGrid account, use this to generate an API Key with Full Mail Send permissions. Once installed, the API Key is popped into the modules config and you should be good to go. Use Cases: It simplifies the process of sending email from servers by removing the need to configure sendmail or other email routing applications on the server. Instead it relies solely on PHP and offloads the sending to SendGrid which can be heavily configured via its UI to ensure better delivery rates for your domain.
  7. @kongondo thanks for looking into it, but I was after an API method which could be called from outside of the page, thus $input would not have the right context for the page you are interested in. More like $pages->get('/foo/bar'); when bar is a segment. Only really needed to know if the segment was valid. @LostKobrakai If you are testing for multiple segments then you'd usually enter them as separate strings within the $segments array. However if you've configured segment paths on your template you could add "some/subsegment" as a single string rather than breaking it apart. Really it needs expanding for this use case as that wasn't what we required from it. Regex tests and more complex lookups are somewhat out of scope. For our use case it worked nicely but that was multiple strings that are not segment paths. Might be interesting to play with the ProcessPageView method though...
  8. Haven't found an API method to support this but have a simple enough workaround if you have the $page at the root of the segments. /** * is the URL Segment valid for the page * @param {Page} $rootPage * @param {Array} $segments * @return {boolean} * */ function validSegments($rootPage, $segments = []) { if (!count($segments) || !$rootPage || !$rootPage->id || !$rootPage->template->urlSegments || (is_numeric($config->maxUrlSegments) && count($segments) > $config->maxUrlSegments)) return false; if ($rootPage->template->urlSegments === 1) { return true; } else if (is_array($rootPage->template->urlSegments)) { foreach ($segments as $segment) { if (array_search($segment, $rootPage->template->urlSegments) === false) { return false; } } return true; } return false; }
  9. Hey, Is there an API method to detect if a URL will match a URL Segment? i.e. If a template serving /foo/ allows segments, and you request /foo/bar/ Just need a boolean to indicate a hit or not. $segmentPage = $pages->get('/foo/bar/'); // returns nullPage At present I can't think of anything short of requesting the page and checking it's http status code: $responseHeaders = wireHttp->head('/foo/bar/'); Both slow and doesn't seem very reliable as the templates output could be manipulating this...
  10. Hey All, Our company is looking to take on PW devs for a variety of client projects. We're London based and ideally would like to work with devs that can come into the office. The projects are pretty wide in scope, so right now we're just looking for viable candidates to ping us a cover note with details on projects you've undertaken, how you utilised PW within them, highlight anything particularly brilliant you did.... If you can direct message me, I'll ping you my email and we can go from there.
  11. Is it possible to search on multiplier fields using a selector? i.e. $q = 'a search query'; $searchResults = $pages->find("textarea_multiplier%=$q"); This produces a fatal error: Error: Exception: Operator '%=' is not implemented in FieldtypeMultiplier Can this be done without looping over the contents of the multiplier?
  12. no worries, thanks for letting me know
  13. Is there a method to add markup to a single input field when building a form? At present I'd customise the forms markup: $form = $modules->get("InputfieldForm"); $form->setMarkup([ 'item_content' => "{out}<span class='custom-span'></span>", .... ]); Which works but adds the custom span to every inputFieldWrapper. Adjusting setMarkup on an individual field, i.e. $field = $modules->get("InputfieldText"); $field->setMarkup([ 'item_content' => "{out}<span class='different-span'></span>" ]); Calls the same method, setting $markup within inputFieldWrapper.php and adjusting the output of every inputFieldWrapper Therefore I was hoping for a way of appending to the inputfield or wrapper without it being global
  14. Awesome pal, that's sorted it.
  15. When using mysql v5.6 with the switch: --sql-mode=ALLOW_INVALID_DATES blank start and end dates get set to 2015 years ago, the dev branch solved this but unfortunately didn't fix the sql error.
  • Create New...