Jump to content

elabx

Members
  • Content Count

    594
  • Joined

  • Last visited

  • Days Won

    3

elabx last won the day on December 29 2015

elabx had the most liked content!

Community Reputation

608 Excellent

About elabx

  • Rank
    Hero Member
  • Birthday 04/12/1988

Profile Information

  • Gender
    Male
  • Location
    Mexico City

Recent Profile Visitors

7,258 profile views
  1. I solved this like this: $wire->addHookBefore('ProcessPageEdit::buildForm', function(HookEvent $event) { $ppe = $event->object; $page = $ppe->getPage(); if($page->template != 'transaccion') return; $pageInputfields = $page->getInputfields()->children(); if($event->user->hasRole('asesor') && $page->transaccion_enviar_admin){ foreach($page->getFields() as $field){ $event->addHookAfter("Field::editable", function($event){ $event->return = false; }); } } }); BUT, I have to turn on access control on the fields and set the fields to be viewable even if not editable. (the checkboxes at the bottom)
  2. Hi everyone! Just came back with another issue trying to solve this "dynamic field access" thing. I've implemented the previous hook @Robin S kindly gave me, but I now have the issue that if I visit the page a second time and save the page again while the conditions within are met (I visit the page a second time, and the fields show as their rendervalue) , the fields data gets deleted! Anyone got any clues on this? I wonder if I have to put a flag somwhere when the form is submitted?
  3. 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.
  4. 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!
  5. 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.
  6. 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.
  7. 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.
  8. 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?
  9. Unfortunately I don't have access to the cloudflare account :/
  10. 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--; }); }
  11. 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.
  12. WOW NICE! Life is what happens when you are editing template context values.
  13. 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.
  14. 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).
×
×
  • Create New...