Jump to content

monollonom

Members
  • Content Count

    69
  • Joined

  • Last visited

Community Reputation

59 Excellent

About monollonom

  • Rank
    Full Member

Contact Methods

  • Website URL
    https://eprc.studio

Profile Information

  • Gender
    Male
  • Location
    Brussels

Recent Profile Visitors

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

  1. Hi Ryan, as part of your rewritting of the WireDatabasePDO class, did you get a chance to have a look at this issue ?
  2. I've never worked with custom page classes but I assume you could add a hook on the "loaded" event of your custom page and execute your custom function, something like : $wire->addHookAfter("CustomPage::loaded", function($event) { $page = $event->object; $page->yourCustomPageFunction(); });
  3. Have you tried with Pages::added ?
  4. Great to read ! About your other request, I had a look at the code and there doesn't seem to be a hook available for what you're looking for (the closest being this non-hookable function). Maybe someone else can come up with another solution.
  5. I had a different setup where I wanted my files served from a sub-domain (even though in the end it was from /site/assets/files), but it's somehow related. What I did was to point the sub-domain to /site/assets/files, and then add this hook in ready.php : $wire->addHookAfter("Pagefile::url", function($event) { static $n = 0; if(++$n === 1) { $file = $event->object; $url = $file->httpUrl; $host = wire("config")->httpHost; $url = str_replace("$host/site/assets/files", "sub.domain.com", $url); $event->return = $url; } $n--; }); You could replace "sub.domain.com" to "domainB.com/site/assets/files" (or even clear the "site/assets/files" part in your case). Hope it helps !
  6. Are these website all on the same server ? Or on shared hosting ? Or do you also have the issue locally ? I have this issue with one of my websites where sometimes the TTBF drops down. Can't say for sure as I did not investigate much yet but I assume it's because there might be other websites on the shared hosting taking too much power. Sorry I'm not helping much so here's a screen of the timings I had for your website, looks pretty normal to me :
  7. If everything seems to point to emails being sent successfully but not received, shouldn't you have a look if the emails go to spam or are refused by the receiving address ? You can try this for example https://www.mail-tester.com/?lang=en
  8. Would showing the path instead of the title be okay ? I thought of a hook first but you could do the trick with a bit of CSS ul.pw-dropdown-menu-shorter li.ui-menu-item a::before { content: attr(title); margin-right: 3px; } ul.pw-dropdown-menu-shorter li.ui-menu-item a span { display: none; } (hopefully it doesn't target anything else, but from my quick testing it looks ok !) Before: After:
  9. Isn't your code missing a bit for $roles ? Right now, and if not, you could just do echo $page->insight_author("<a href='{url}'>{title}</a>, {staff_role}");
  10. Not sure if this is what you're looking for (or if you already know about it) but explaining the focus feature to your editors might come handy for you when generating variations for srcset. If cropped, the image returned will respect the focus point and try to keep it centered.
  11. Hm not really since in the end it's about PW outputting data, whether it's within HTML tags or as a json object. Here you only provide a very small sample of your setup so it's hard to tell, but there could a number of things that impacts the performance of PW. Hooks that take a long time to execute or something... Using TracyDebugger could help you narrow down what's going wrong.
  12. At least it's cleaner ? 🤷‍♂️ Re: perf difference, I can't say for sure but maybe having the file in the root made it so it's called outside of PW's context ? That may explain why it's faster as it would be raw php.
  13. It should work for your situation as well. Render your HTML markup and once you're done and want to stop PW output call $this->halt. Try and let me know if it works. Edit: That is, in your initial setup where you have _main.php included by default after your template
  14. I assume you're using the markup regions output strategy ? If so, when getting an ajax call, once you're done in your code and have echoed your response, you can call $this->halt(); to stop the template output (from https://processwire.com/blog/posts/processwire-2.6.8-brings-new-version-of-reno-admin-theme-and-more/#new-this-gt-halt-method-for-use-in-template-files) (I couldn't find it referenced in the doc though...) So for example in my case I have (in my page.php) if ($config->ajax) { http_response_code(200); header('Content-Type: application/json'); // code to populate $json echo json_encode($json); return $this->halt(); }
  15. Ok one issue though is that it's a global setting so I'm not sure how it will play out with the rest of your setup... so maybe you do need to use a hook in the end to be able to change this setting before ProcessPageAdd is started.
×
×
  • Create New...