Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. No. Its a file field not a folder field.
  2. Just want to note that in case of multi-instance usage $this->wire("config")->paths->templates != config()->paths->templates So in modules developement you should avoid using function API.
  3. So if im in france ill see the french version and not understand anything and cant change it? Sorry happened to me and got really frustrated and simply left the service.
  4. For me it's the worst you can do, and I hate it when I get redirected to a language I don't want. Sometimes you can't even get to another language. Just don't ever do automatic redirection based on anything.
  5. Or you can even use the class name too config()->scripts->add(config()->urls->{$this->className} . 'scripts/createInvoiceButton.js');
  6. config()->scripts->add(config()->urls->RockCRM . 'scripts/createInvoiceButton.js');
  7. A friend wrote his own OS from scratch back 15 years ago. He was way ahead of competition and was telling the same things about how bloated and inefficient softwar3 and specially os's are. He's dad run a software company he also worked in but only got doubted and ignored somehow. He kept at it for almost 7 years until he proved everybody wrong. He could do things even seniored software guys got blown away. He's system was so small and efficient and only was about a couple Mb in size that would extract to some gb of data (ofc the apps) . He could install a whole computer network with 50 laptops in about 1m and boot them up all at the same time im 5s from his laptop. He was into clustering and had big things in mind. He's system they used for a central payment system that did run for +3 years without one single restart or outtage or problem. They were so impressed that they ordered more. Sadly he got fired by his own dad because of he work philosophie and had his problems. Unfortunately he died of cancer 11 years ago. His work kinda lost. Makes me sad and not a single day pass by without thinking of him. Yet 10 years later sadly nothing has changed in the industry. I'm so happy there's still people around who care.
  8. No it's not fully supported.
  9. You should not use "post" but "get" for a searchform. This way it's not trying to resubmit the form. The design pattern when using "post" for Forms usually is PRG https://en.wikipedia.org/wiki/Post/Redirect/Get
  10. Your hook doesn't tell anything about how you manipulate the data. This works just fine for me in ready.php : $this->addHookBefore("ProcessPageEdit::processInput", function (HookEvent $event) { $form = $event->arguments("form"); if($form->get("lat")) { $this->input->post->lat = 12; } });
  11. Something like https://processwire-recipes.com/ ?
  12. I have a ~40k CSV rows import/sync that runs for almost an hour. And it's not even importing, just syncing. If you use the API to load and cycle through lots of pages it is slow, there's no real way around it except doing it in SQL directly.
  13. Just to correct, if you have edit right and a language or page is unpublished you still can see it if logged in. It's just that maybe something like the language nav that wouldn't show the switch link for that language, but it can be coded to be seen by editors.
  14. This return the correct url for me $user->editUrl(true);
  15. If you set an explicit protocol on the template, $page->httpUrl() will return correct https if set. $input->httpUrl(true); Will return the full requested url with protocol and query string / url segments.
  16. There's no group by feature in PW. WireArray->unique() doesn't work for this purpose. Using the API you could Just build an array using WireArray->explode() and use array_unique(). Depending how large the result set is you could cache the array so it only builds the array when it expires or based on a selector. $uniquedates = $cache->get("uniquedates", "template=basic-page", function(){ return array_unique(wire("pages")->find("template=basic-page, sort=date")->explode("date")); }); print_r($uniquedates); If the amount of entries is very large and it would take several seconds to build the array, it could make sense to use something like direct SQL query.
  17. Also I wouldn't use "$files" as that is a PW template variable. https://processwire.com/api/ref/files/
  18. $name = str_replace("_", "", $file->name);
  19. I'm not sure I can follow you. What cache are you using then? PW template cache can be cleared in the core module "PageRender"
  20. Thanks @adrian I think I got it sorted out. New version 1.0.4 is pushed.
  21. Why not just use the Page reference Autocomplete?
  22. I guess you have to prevent the redirect for your download template? So don't redirect if template is xy I guess? Or not include it in the first place?
  23. It's not as easy. This can lead to all sorts of problems as you only change the template var $page and it may work for simple cases. But PW already has set and loaded the requested page internally at this point and other code (in templates, modules etc) may not work correct as they will still ”see" the other page.
×
×
  • Create New...