Jump to content

guy

Members
  • Posts

    61
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    London, UK

Contact Methods

  • Skype
    guycampbell

Recent Profile Visitors

3,357 profile views

guy's Achievements

Full Member

Full Member (4/6)

21

Reputation

1

Community Answers

  1. @gs-df thank you so much for the recommendation - just plugged it in and it does exactly what I need. @Robin S thank you as well for your work on this module.
  2. I'm looking to change the visibility of child fields within a repeater based on the value of a field on the owner page (the page on which that repeater appears). To illustrate: Owner (Page) - type (select field) ---- type_one (option) ---- type_two (option) - things (repeater field) ---- thing_one (child field) ---- thing_two (child field) With the above set up, when you select type > type_one then within the repeater the visibility of things > thing_two would be set to hidden. I don't mind how I go about doing this - at present I've tried the following hook within ready.php: $wire->addHookAfter('ProcessPageEdit::buildFormContent', function (HookEvent $event) { $page = $event->object->getPage(); $form = $event->return; $thingsField = $form->getChildByName('things'); ... // but past this point I haven't been able to select $thingsField child input fields }); The above gets me access to an InputfieldRepeater as $thingsField but I'm not sure how to then drill down into its child input fields. If I could get access to child input fields I'd then assume I can set showIf to a nonsense value to hide the field, i.e. $childInputField->showIf = 'true=false'; Any help with the above would be much appreciated.
  3. 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?
  4. just updated to v1.1.4 with the bug fix
  5. @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.
  6. @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.
  7. @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.
  8. 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.
  9. @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...
  10. 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; }
  11. 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...
  12. 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.
  13. 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?
  14. no worries, thanks for letting me know
  15. 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
×
×
  • Create New...