Jump to content

markus-th

Members
  • Posts

    127
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by markus-th

  1. If you are using Pages2PDF eg. WirePDF you can update the module from my updated fork: https://github.com/markusthomas/Pages2Pdf
  2. Sounds you use a mPDF-Version < 8.0.10 PHP 8 is not supported on older versions. -> https://github.com/mpdf/mpdf
  3. Learned something again, thanks @bernhard for this hint.
  4. 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();
  5. 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 }); });
  6. 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
  7. ChatGPT will teach us something ... We really need a ProcessWire Conference ?
  8. Of course, after all Kulmbach is the secret capital of beer ? Greetings to Bamberg ?
  9. ?‍♂️ I would leave a beer from Franconia for the module ?
  10. You don't need a plugin for this, you can do it directly in the details tab in the field settings.
  11. 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.
  12. I have found the problem. You have to disable AJAX in the repeater settings, then saving works.
  13. I have the same issue. Maybe @ryan can help with that?
  14. 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.
  15. 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); });
  16. 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
  17. 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/
  18. Have you tried to remove the template in the FileCompiler-Folder? You find it here: /site/assets/cache/FileCompiler/templates
  19. That is okay, and i use it always like this. But your sorting-HTML is not in this template ... this is only the pagination.
  20. I mean the template that generates the HTML of the sortinglink.
  21. How look the output? I think the generated sortinglink ist wrong.
  22. You can use the URL-Hooks. https://processwire.com/blog/posts/pw-3.0.173/ I think this should be the simplest solution.
  23. 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?
  24. Have you set a RewriteBase in your .htaccess?
  25. Try this as Operator: ~%= or ~*= I use this on all my sites with the AjaxSearch module, but it should work here as well. Here you can find Ryan's blogpost: https://processwire.com/blog/posts/pw-3.0.160/
×
×
  • Create New...