-
Posts
1,459 -
Joined
-
Last visited
-
Days Won
19
Everything posted by elabx
-
Using $files->render() in a loop is expensive, cache it!
elabx replied to elabx's topic in Getting Started
You're right @monollonom, it doesn't seem to cache per render per call which would be the most useful case! Looking at the usage in TemplateFile class, it seems the options passed to render() get passed on to $cache->renderFile(), where we can pass on the name paremeter to specify a unique cache name. Updated the example! I had a very simple case where I was delegating the rendering of list items to another file and I was very surprised how slow everything turned, ProfilerPro was very usefull figuring this out. It wasn't even a big list, just like 40-50 items. I kept debugging what was inside the include file until finally figuring out it was the render() call that killed performance. -
Example: foreach($list_of_cards as $card){ // cache cleared then selector matches $files->render("inc/some-include", $vars , ["cache" => "template=some_template", "name" => "template_cache_{$card->id}"]) } Available since version 3.0.130
-
I'd vote for this too.
-
Hi everyone! And thanks for the great work in the new admin, I kind of also agree on the checkboxes! I'd skip the white version, your logo looks great in dark mode. I'd also vote on the customization of the logo! I think @bernhard's logo on the screenshot is just a nice coincidence, but I'd say most of the times it wont work out of the box? Been testing it a little bit my block building setup using repeater matrix ,also nested repeaters, and at first glance I kinda miss the depth the repeaters added with a slightly darker background color. Will report back with more concrete examples!
-
create/update/delete pages on PW site B depending on data from PW site A
elabx replied to ttbb's topic in General Support
I seems to me that you have a pretty clear idea overall on how to do it. The closest I've done to this I decided to use queues to handle anything having to import through that, since I had to import images too so didn't want to go into timeout issues. So the import action actually got triggered from Site A on a Page:saved hook, which passed the page ID to an endpoint in Site B, which then triggered the creation of a queue item that then got back to an "import endpoint" on Site A. The processing on Site B is managed by supervisor. The part I wouldn't know how to solve is how to temporarily setup the reverse proxy with dyndns/ngrok. First thing that comes to my mind is to maybe have a cloud based thing in the middle like Amazon SQS so you can organize the work of Site A and Site B in one place. -
There is a discussion going on here that could involve what's happening to you (and some of us!): https://github.com/processwire/processwire-issues/issues/2061
-
Looks like a nice scenario for HTMX.
-
Woah nice! U the MVP, I guess it's the usual ProcessWire double edge sword, since possibilities are up to you, well, gotta work on your flavor of AI rules. 🦾
-
I love this goddamn AI blackmagic too, miss PHPStorm like the dessert miss the rain but what to do, their AI integration is just subpar compared Cursor's. Anyone working with rules for ProcessWire?
-
For this error, can you try changing your session handler?? In case you are using the default, try SessionHandlerDB?
-
Would you duplicate pages with matrix repeater content
elabx replied to tires's topic in General Support
I do this regularly with repeater matrix and even nested repeaters and it just works! -
Oh why does this happen? It worries me I might encounter this sometime.
-
@jploch no!! sorry for the confusion
-
I think for this specific "hierarchy" you might benefit from looking at AdminRestrictBranch and if it doesn't exactly fit your needs you'll get some ideas for hooks within it's code, although I understand you are new to ProcessWire but from the looks of your project you're in for a ride! Keep in the touch and welcome to the forums! So you might benefit from having various roles that fit the "branch" where you want to work on.
-
$pages->clone() not working as expected with recursive parameter?
elabx replied to bernhard's topic in General Support
I completely missed this syntax! I am living in the PHP of the past 😭 -
$pages->clone() not working as expected with recursive parameter?
elabx replied to bernhard's topic in General Support
I think $parent is the second parameter not the recursive flag (which is true by default)? 🤔 -
Did this thread cursed me? (jk) Monday first hour and I have a site that's going through very odd gateway timeouts 🤣 EDIT: Indeed, server load! PHP hits hard, always have a cache layer! 😄
-
Have you checked your server load? This is my most common case for this timeouts.
-
I know this is more of a Vite question, does anyone happen to know how to build a separate CSS file that can be used in TinyMCE or CKEdito, but in which I can reuse some of the CSS that is used on the "client facing" site, I am using LESS and it would be nice to just have buttons, headings and body font exported into the CSS file used by the text editors.
-
Character counter and max char settings - both not working?
elabx replied to Sebastian's topic in General Support
There is a bit of discussion about this here too: https://github.com/processwire/processwire-issues/issues/2032 -
TinyMCE media plugin in combination with purifier does not work
elabx replied to Didier B.'s topic in General Support
I struggled with this too, I didn't give it a shot but I thought of hooking the MarkupHTMLPurifier but I didn't find a reasonable point to hook into, maybe here? But would love to scope it to InputfieldTinyMCE. -
@adrian this looks oddly similar to what happened with the repeater matrix
-
My bad, hadn't noticed the .htaccess files, great idea!