-
Posts
51 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Markus Thomas
-
@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.
-
mPDF error: No font or default font set!
Markus Thomas replied to Frank Schneider's topic in General Support
If you are using Pages2PDF eg. WirePDF you can update the module from my updated fork: https://github.com/markusthomas/Pages2Pdf -
mPDF error: No font or default font set!
Markus Thomas replied to Frank Schneider's topic in General Support
Sounds you use a mPDF-Version < 8.0.10 PHP 8 is not supported on older versions. -> https://github.com/mpdf/mpdf -
Learned something again, thanks @bernhard for this hint.
-
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();
-
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 }); });
-
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
-
Strategies for including google places reviews
Markus Thomas replied to Stefanowitsch's topic in Dev Talk
Of course, after all Kulmbach is the secret capital of beer 😂 Greetings to Bamberg 😉 -
Strategies for including google places reviews
Markus Thomas replied to Stefanowitsch's topic in Dev Talk
🙋♂️ I would leave a beer from Franconia for the module 😉 -
[SOLVED] How to create a custom label for each repeater?
Markus Thomas replied to Boost's topic in General Support
- 1 reply
-
- 3
-
-
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.
-
Custom image fields data get lost in nested repeaters
Markus Thomas replied to dec3's topic in General Support
-
Custom image fields data get lost in nested repeaters
Markus Thomas replied to dec3's topic in General Support
I have the same issue. Maybe @ryan can help with that? -
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.
-
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); });
-
UrlSegments with Pagination is throwing blank page [SOLVED]
Markus Thomas replied to Martinus's topic in API & Templates
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 -
UrlSegments with Pagination is throwing blank page [SOLVED]
Markus Thomas replied to Martinus's topic in API & Templates
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/ -
Refresh translations json - Can't add strings
Markus Thomas replied to sgpcreativa's topic in General Support
Have you tried to remove the template in the FileCompiler-Folder? You find it here: /site/assets/cache/FileCompiler/templates -
UrlSegments with Pagination is throwing blank page [SOLVED]
Markus Thomas replied to Martinus's topic in API & Templates
That is okay, and i use it always like this. But your sorting-HTML is not in this template ... this is only the pagination. -
UrlSegments with Pagination is throwing blank page [SOLVED]
Markus Thomas replied to Martinus's topic in API & Templates
I mean the template that generates the HTML of the sortinglink. -
UrlSegments with Pagination is throwing blank page [SOLVED]
Markus Thomas replied to Martinus's topic in API & Templates
How look the output? I think the generated sortinglink ist wrong. -
You can use the URL-Hooks. https://processwire.com/blog/posts/pw-3.0.173/ I think this should be the simplest solution.
-
Keep getting logged out, regardless of settings
Markus Thomas replied to Goca's topic in General Support
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? -