Jump to content

elabx

Members
  • Posts

    1,248
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by elabx

  1. I think the Page::viewable hook might help you here: <?php wire()->addHookAfter('Page::viewable', function($event) { if(!$event->return) return; // already determined user has no access if(wire('user')->isSuperuser()) return; // superuser always allowed $page = $event->object; if($page->users_created_id != $this->user){ //Don't let user view page $event->return = false; } });
  2. Interesting app to design emails: https://imperavi.com/revolvapp/
  3. Had forgotten about it also!! Hope you are up to this version of PW: https://processwire.com/blog/posts/pw-3.0.111/ Maybe this would work? //In the context of the hook $p->name = $this->pages->names->uniquePageName($this->sanitizer->pageName($p->title));
  4. Try this: $page = $pages->get('name=page-to-move'); $page->of(false); $page->parent = $pages->get('name=new-parent'); $page->save();
  5. Fields can be configured to have access level per role. If you edit the redirect field, go into the Access tab and enable access control, you can enable the fields you need for certain roles.
  6. I've uses LastPass a couple years. Love having the chrome extension at hand to get any pass. Autofill might not always work great tho.
  7. From what I understand, repeater order is actually just the page order within the tree branch, so you might want to dive a bit into the tree to see if you can move stuff around and reflects itself in the repeater.
  8. It's jQuery UI! And the sidepanel is just an animated div, nothing fancy really.
  9. Interesting read, thanks! Great to know it's hookable. I was also gladly susprised that there was a way to specify the order of the words in the relative time output, that sealed the deal!
  10. What I've done in this scenarios is adding a new method through a hook to pages, something like $page->customUrl() that checks conditions before outputting the url.
  11. Maybe with prevAll() ? https://processwire.com/api/ref/page/prev-all/ $prev = $page->prevAll(); //Asuming it returns sorted in the same order (I'm not certain) get the last 10 pages $prev = $prev->slice($prev->count - 10);
  12. Is it possible to get output on another language the relative dates on lister fields (like modifed, creation date)?
  13. Where is getRatio() getting called? I think we would need more context of your includes to help you.
  14. Maybe this module is what you might be looking for: https://modules.processwire.com/modules/helper-field-links/
  15. Hi! Does anyone know if the dependency support is still limited in repeaters? Tryin to use them within a repeater matrix like: page_field.count>1
  16. For what I can tell the tables use jquery table sorter for this task. Maybe you can check in their documentation how to restart the plugin with the format you require. Found this also, specific to date formats.
  17. Awesome!! I'm also interested in how you changed the Repeater Matrix labels to images ?
  18. I can't teven find where that is defined in the source code haha I'd guess some $_SERVER value is not populated? That's what I hoped to find out searching: https://github.com/processwire/processwire/search?q=httpRoot&amp;unscoped_q=httpRoot
  19. If I understand correctly, something like this should work, let us know if you need more detail: wire()->addHookekAfter("Pages:saved", function($e){ $page = $e->arguments(0); if($page->template == "one"){ $pageTwo = $page->child("template=two"); if(!$pageTwo->id){ //create child page code and save! } } });
  20. @jacmaes Thanks a lot for your answer! I was very excited about this, but then started to think of all the possible caveats and just decided to take it slower and ask here for experiences with it. I am also eagerly awaiting @horst 's module, think I'll just rather wait.
  21. Hi! Has anyone tried this in their servers? If so, what's your experience with it? I am particularly interested in the auto webp conversion/ https://developers.google.com/speed/pagespeed/module/
  22. I'll try to find time to write a simplified version of the module and share it here. (because the module I wrote is a bit quite messy code wise).
  23. Truth is I would have also assumed ImageMagick as a requirement!
  24. Apparently not! This is the file for the GD engine, found it in the github issues where where this feature was being discussed and @horst published changes for both GD and imagemagick engines. https://github.com/horst-n/processwire/blob/f072a52ccec7ffadd6831b5002ebd0b569274216/wire/core/ImageSizerEngineGD.php#L286 But maybe GD needs something else (some config?) to support it??
  25. For what I have experienced, the interlace parameter should be enough. Also, be aware that any previously created image won't behave as progressive.
×
×
  • Create New...