Jump to content

Markus Thomas

Members
  • Posts

    51
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Markus Thomas

  1. @DV-JF I also had the same behavior that no core updates were displayed. This phenomenon was only with Processwire installations that were already somewhat older. I then noticed that the ready.php in the site folder were different for these old installations. Replacing them with a new ready.php resulted in the coreupdates being displayed again. But be careful, if you already have a modified ready.php, you have to make these changes in the new file too.
  2. If you are using Pages2PDF eg. WirePDF you can update the module from my updated fork: https://github.com/markusthomas/Pages2Pdf
  3. Sounds you use a mPDF-Version < 8.0.10 PHP 8 is not supported on older versions. -> https://github.com/mpdf/mpdf
  4. Learned something again, thanks @bernhard for this hint.
  5. You don't need a module, it can be done by a hook in the ready.php and an warningpage (with own template). -> https://processwire.com/api/ref/session/login-success/ $this->addHookAfter('Session::loginSuccess', null, function ($event) { if ($this->wire('user')->hasPermission("specific_role")) { $session->redirect($pages->get("/warningpage")->url); } }); On the "warningpage" log the user out with this code in the template: $session->logout();
  6. The only problem i see is, you have to do some workarounds that each user only see his own subdomain. Otherwise all users see all sites in the adminarea. A hook in ready.php could look like this: $this->addHookAfter('ProcessPageList::find', function ($event) { $event->return->each(function ($p) use ($event) { if (!$p->editable() && !$p->addable()) $event->return->remove($p); else if ($p->template == 'subdomain-home' && !$this->user->hasRole("superuser") && !$this->user->hasRole(strtolower(str_replace(' ', '-', $p->title)))) $event->return->remove($p); // title from homepage and userrole have the same name }); });
  7. Since I had to update more and more projects lately and also the PHP version of some of these projects was set to >=8 in the meantime I created a fork of the module and updated mPDF to version 8.1.3. With only some small changes in the WirePDF module I can now continue to use Pages2PDF without any restrictions. Maybe this is helpful for someone. https://github.com/markusthomas/Pages2Pdf
  8. ChatGPT will teach us something ... We really need a ProcessWire Conference 🤩
  9. Of course, after all Kulmbach is the secret capital of beer 😂 Greetings to Bamberg 😉
  10. 🙋‍♂️ I would leave a beer from Franconia for the module 😉
  11. You don't need a plugin for this, you can do it directly in the details tab in the field settings.
  12. Also tested it ... wow that's awesome. Phrase: how to add a new field to a processwire template via api To add a new field to a ProcessWire template via the API, you can use the $fields->save() method. This method allows you to create a new field and add it to a template using a PHP script. Here is an example of how this could be implemented: // Use the Wire class to access the ProcessWire API $wire = Wire(); // Get the fields and templates modules $fields = $wire->fields; $templates = $wire->templates; // Create a new field $field = $fields->newField(); // Set the name and type of the field $field->name = 'my_field'; $field->type = 'text'; // Save the field $fields->save($field); // Get the template to which you want to add the field $template = $templates->get('my_template'); // Add the field to the template $template->fields->add($field); // Save the template $template->save(); In the example above, we use the $fields->newField() method to create a new field, and then use the $fields->save() method to save the field. We also use the $templates->get() method to get the template to which we want to add the field, and then use the $template->fields->add() method to add the field to the template. Finally, we use the $template->save() method to save the template with the added field. Note that this is just one way to add a new field to a ProcessWire template via the API. There may be other approaches that could work as well.
  13. I have found the problem. You have to disable AJAX in the repeater settings, then saving works.
  14. I have the same issue. Maybe @ryan can help with that?
  15. Live Server is not suitable, because it cannot parse PHP or establish a database connection. I would recommend you to work with XAMMP (or MAMP for Mac) for local development.
  16. This work in my case whithout any problems $wire->addHook('/existing-page/([0-9]+)', function ($event) { $id = $event->arguments(1); $post = $event->pages->findOne("template=product, id=$id"); if ($post->viewable()) $event->session->redirect($post->url); });
  17. Just try <li><a class="dropdown-item" href="<?= $page->url('name-asc') ?>">Name (A-Z)</a></li> instead of <li><a class="dropdown-item" href="name-asc">Name (A-Z)</a></li> This should fix the link
  18. This link simply adds "name-asc" to the end of the actual URL. But you have to switch between "name-asc", "name-desc" etc. For this you have to specify the complete url https://processwire.com/api/ref/page/url/
  19. Have you tried to remove the template in the FileCompiler-Folder? You find it here: /site/assets/cache/FileCompiler/templates
  20. That is okay, and i use it always like this. But your sorting-HTML is not in this template ... this is only the pagination.
  21. I mean the template that generates the HTML of the sortinglink.
  22. How look the output? I think the generated sortinglink ist wrong.
  23. You can use the URL-Hooks. https://processwire.com/blog/posts/pw-3.0.173/ I think this should be the simplest solution.
  24. I even use Cloudflare on the most of my sites and had the same issues. Since i use $config->sessionFingerprint=false; everything works fine. Maybe you have to use false instead of 0?
  25. Have you set a RewriteBase in your .htaccess?
×
×
  • Create New...