-
Posts
1,523 -
Joined
-
Last visited
-
Days Won
21
Everything posted by elabx
-
echo $page->render; Just take into account that this will render the header and footer if you have included them on the child pages templates.
-
Newbie question: How I can load image(s) from another template blog-post
elabx replied to howdytom's topic in Getting Started
I think the main issue here is like you say, they images field is an array, so you have to grab the image you need (for example, the first one): $blogimages = $blogpost->images; $imgthumb = $blogimages->first()->size(500, 300); Double check your images field is actually showing up as an array. Best of luck! -
hahaha thanks a lot for you help and patience! I just pinged on an nginx thread to check if anyone's got some more info.
-
HI everyone! Has anyone configured nginx to serve webp images through some rules? Just like proposed using htaccess rules in this blog post. I am currently using Runcloud setup with nginx + htaccess and I can't get images to get served as webp so I am going to guess the issue is that static files are getting served through nginx.
-
Hu @wbmnfktr!! Your post just made me realize, I'm using Runcloud so I have nginx in front of Apache, and just tested another site that is not using cloudflare and same issue, webp is not being delivered. So maybe that could be it? Cause i remember the http-to-https redirect had an issue, so i had to use a special one.
-
Role with view permission only to pages of specific template
elabx replied to ottogal's topic in General Support
A hook on Page::viewable? -
This is my "go to" approach but susprisingly it didn't work out as expected. It just delivers the normal jpg image it's as if it's not redirecting the webp header or something, that's why I decided to switch to the extension hook but then I stumbled into this. Maybe I should open a github issue?
-
Unfortunately I don't have access to the cloudflare account :/
-
Ok so just stumbled into a website using Clouflare and the plain htaccess method doesn't seem to kick in, tried altering the url() method with a hook but stumbled back into the problem problem where it doesn't seem to work after applying size(). Anybody has some info on this? if($page->template != 'admin') { $wire->addHookAfter('Pageimage::url', function($event) { static $n = 0; $n = ++$n; if($n === 1){ $event->return = $event->object->webp()->url(); } $n--; }); }
-
I've always wondered why does this involve better performance? I've read it's better at serving static files? I have uses runcloud/serverpilot which use nginx as reverse proxy, but I haven't really taken the time to test for speed or to understand if ProcessWire takes advantage of this.
-
WOW NICE! Life is what happens when you are editing template context values.
-
I'm not familiar with Django but for what I've seen, most PW users try to "translate" any other app models into page templates, and make a migration using either queries to the original database or leveraging any sort of API (REST/XML?), and creating the pages using the PW API.
-
Hi everyone! Has anyone worked with the Paypal Javascript SDK? I understand I can do this, for funding errors, but is this really the only error that could get thrown by the SDK? I'd like to test it like implied in the negative testing docs, but I don't know where to set the headers on the Buttons javascript object (or if it is even possible).
-
And talking about "shop features" there's https://www.padloper.pw/ But I'm guessing you'll still have to do some dev work. There's also this module to compliment padloper: https://modules.processwire.com/modules/payment-mollie/ What you mean with "simplest solution"? For me simplest would be a payment button with an input to indicate quantity and that's it. But don't know if you want to save as orders, accounts, etc.
-
I think the best chance is to post it in the issues github repo.
-
How to insert additional checkbox into page edit form
elabx replied to FlorianA's topic in API & Templates
Thanks @Robin S ! I won't add useless Checkboxes anymore to my templates! :D -
How to insert additional checkbox into page edit form
elabx replied to FlorianA's topic in API & Templates
My normal take on this is adding a normal checkbox field to the template (even though I guess it's an overkill ). That way on Pages::saved I can check for the value and reset it to unchecked saving only the field. Probably adding the field through an "after" hook on ProcessPageEdit::buildForm (or buildFormContent) as it returns the object that has the form fields so you can go through them and add other stuff you might need. Though I wouldn't know on which other hook I could catch it to process the input. (for example, I don't know if the data from this fake field would reach Pages::saved or even create an error). -
Wow thanks! I'm constantly searching PW source for hook references, this will be very useful!
-
That feeling is simply awesome! Welcome to the community :)
-
You can take a look at this module: Or you can build your own image uploader with something like Dropzone.js and some guide from this topic: I think the main backend code to upload and save image to disk and add to page field is within this post: https://processwire.com/talk/topic/67-front-end-image-uploader-like-admin/?do=findComment&comment=3790 $size=filesize($_FILES['imageUpload']['tmp_name']); if ($size > MAX_SIZE*1024){ print 'File troppo grosso'; exit; } //copy the image in secure folder $image_name=time().'.'.$extension; $newname="../site/tmpfiles/profiles/".$image_name; $copied = copy($_FILES['imageUpload']['tmp_name'], $newname); if ($copied) { $userid = $sanitizer->text($input->post->userid); $u = $users->get($userid); $u->setOutputFormatting(false); $u->profilephoto->add("http://".$_SERVER['HTTP_HOST']."/site/tmpfiles/profiles/".$image_name); $u->save(); //delete copied image $tmpfile = $_SERVER["DOCUMENT_ROOT"]."/site/tmpfiles/profiles/".$image_name; if (file_exists($tmpfile)) { unlink ($tmpfile); } }else{ print "Errore nel salvataggio del file."; exit; }
-
For what I understand you don't really need a plugin even though one could do it, from the last time I implemented something like this it's just javascript placed on the header/footer and placing the right HTML element.
-
The validation/publishing is easily setup with users that can create and edit, but not publish permissions. About Jetpack, that I don't know, maybe just Google Analytics? I'd use AdminOnSteroids adjustments for CKEditor. I have a magazine project with some friends running around a 1,000 articles for a couple years, 30k visits a months or more, and the only maintenance I give is new features, in a Wordpress site you'd have to be updating everything like every couple weeks or less and praying nothing dies (maybe it's an exaggeration by this point? but has happened to me when I still used WP for a couple project. )
-
I just ran into a similar problem a couple weeks ago. The fix that did it for us was increasing innodb_buffer_pool_size from 4G to 20G BUT, after that just a couple weeks ago I got errors with data corruption, can't say if it's related.
-
And it's MIT? Let's fork it and make it InputfieldNiceEditor haha