Jump to content

Markus Thomas

Members
  • Posts

    59
  • Joined

  • Last visited

  • Days Won

    1

Markus Thomas last won the day on April 1 2021

Markus Thomas had the most liked content!

About Markus Thomas

  • Birthday August 1

Contact Methods

  • Website URL
    https://www.dothiscookingthing.de

Profile Information

  • Gender
    Male
  • Location
    Kulmbach, Germany

Recent Profile Visitors

1,865 profile views

Markus Thomas's Achievements

Full Member

Full Member (4/6)

78

Reputation

  1. I can understand that, for me it's just always the same ID. Alternatively, you can also overwrite the LogoURL in admin.php. Directly before: require($config->paths->adminTemplates . 'controller.php'); with: $adminTheme->logoURL = $mylogourl I use this for multisites where I need different logos depending on the URL.
  2. I don't know if my way is better, but for me it has become standard 😉 This is easy done: I set the imagepath in AdminTheme to: '/site/assets/files/1020/be-logo.svg' (1020 is my settingspage) and to make sure that the image name is always the same I use the Custom Upload Names module. Now I can simply upload a new logo and have it available in the backend. I exported this configuration with some fields and settings that I need again and again with the Profile Exporter from @ryan and use this as a starting point for almost every new installation.
  3. I have a suspicion, can it be that you have a template and a repeater with the same name? Normally you can find all repeater elements under "Admin". You could try moving the pages there and then changing the template name.
  4. Very many interesting approaches. Therefore, I would like to show my solution as well. I also use the repeater matrix but with nested elements. This gives me maximum flexibility and requires fewer "static" elements.
  5. That could have been me 😂
  6. Ingenious, that means in the ready.php the HTMX request does not have to be declared extra. Note to me: RTFM 🙂
  7. @bernhard This works pretty well for static content, but unfortunately not for content filtered by URL parameters, for example. I really like to use HTMX to dynamically load and replace content on pages. Also asynchronous loading of partial parts of the page becomes very easy. Here is a simple example of the output of a product tile with URL hook <?php foreach ($items as $key => $item) { $pos = $start + $key + 1; ?> <div :hx-get="'/getproduct/'+<?= $item->id ?>" hx-trigger="revealed" hx-indicator=".loader" class="product-tile"> <div class"loader"> Some fancy loader :-) </div> </div> <?php } ?> The hook: (getproduct.php) <?php namespace ProcessWire; $wire->addHook('/getproduct/{prodid}', function ($event) { $id = $event->arguments('prodid'); $item = $event->pages->get("template=product, id=$id"); ?> <div> <p>Producttile</p> </div> <?php exit(); ?> And of course in ready.php include 'templates/functions/getproduct.php'; if (array_key_exists('HTTP_HX_REQUEST', $_SERVER)) { $config->appendTemplateFile = ''; $config->prependTemplateFile = ''; $config->htmxRequest = true; } Maybe that's what @Jonathan Lahijani means by gymnastics. For me personally, this is not a special effort and is actually already part of my workflow. Disclaimer: I know this is not Markup Regions 😉
  8. @cb2004 Maybe it was a coincidence in my case, however, it worked exactly like that for me in 3 installations.
  9. @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.
  10. If you are using Pages2PDF eg. WirePDF you can update the module from my updated fork: https://github.com/markusthomas/Pages2Pdf
  11. Sounds you use a mPDF-Version < 8.0.10 PHP 8 is not supported on older versions. -> https://github.com/mpdf/mpdf
  12. Learned something again, thanks @bernhard for this hint.
  13. 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();
  14. 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 }); });
  15. 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
×
×
  • Create New...