Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


bernhard last won the day on October 14

bernhard had the most liked content!

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Vienna, Austria
  • Interests

Recent Profile Visitors

16,603 profile views

bernhard's Achievements

Hero Member

Hero Member (6/6)




Community Answers

  1. Can anybody try if downloading https://www.baumrock.com/site/assets/files/1192/mockup_mustangs.800x0.png via WireHttp works on their end please? $http = new WireHttp(); $http->download('https://www.baumrock.com/site/assets/files/1192/mockup_mustangs.800x0.png', __DIR__ . '/tmp.jpg');
  2. Thx, unfortunately that did not work. I also tried verify_peer_name without success..
  3. Hi everybody! I'm using the on-demand file downloading feature as shown here: https://processwire.com/blog/posts/pw-3.0.137/#on-demand-mirroring-of-remote-web-server-files-to-your-dev-environment Unfortunately I'm getting the following error in one of my projects: The certificate seems to be valid from what I can see in the browser. I have no idea what I could do or how I could debug that 😞 Any ideas? Thx in advance!
  4. We have a hook for that by now: https://processwire.com/api/ref/pages/published/ <?php $wire->addHookAfter("Pages::published(template=yourpagetemplate)", function(HookEvent $event) { $page = $event->arguments(0); $mail = new WireMail(); $mail->subject("Page {$page->title} has been published..."); ... $mail->send(); }); Not sure if that is really what you want though... Maybe you want to send an email when the page is created? Then Pages::added is for you: https://processwire.com/api/ref/pages/added/
  5. maybe you are just missing a second & ? & --> && if($status & Page::statusUnpublished) {
  6. This is how RockMigrations does it: https://github.com/BernhardBaumrock/RockMigrations/blob/4f4805a3d27c64246cd15a94a16ef27a98f12ec4/RockMigrations.module.php#L1656-L1687
  7. Nice! I'm not an UI expert but personally I'd find it more intuitive to have a grid/list switch in the inputfield header similar to the image field: Not sure, just wanted to share that idea 🙂
  8. ProcessPageAdd.module has this (that is the process module that is executed when adding a page): $form->addClass('InputfieldFormFocusFirst'); And inputfields.js has this note: * - InputfieldFormFocusFirst: Class assigned to form that should focus the first field. ProcessPageEdit does not add this class, so there is no field focus on edit screens. What I'd do is probably this: // in site/ready.php $wire->addHookAfter("Inputfield(name=title)::render", function(HookEvent $event) { // we focus the field only if it is empty if($event->object->value) return; // show a hint and focus the field $event->return .= "<div>Please enter something here</div>" ."<script>$(function() { Inputfields.focus('#Inputfield_title') })</script>"; });
  9. I'd say that building a custom fieldtype + inputfield would be the best option 🙂
  10. Yes, I think this is exactly what I will do. Like you say, it's easy to do so might as well. As a simple addition to @FireWires great answer: Don't forget about the relatively new url hooks! https://processwire.com/blog/posts/pw-3.0.173/ You don't need a dedicated page then (which means that you also do not need to hide that page from the tree via hooks)
  11. Just reset the name + password for the superuser, then you can login as that user and create other users or edit them and their roles.
  12. you can add ?field=foo or ?fields=foo,bar but that will then show only the fields listet in the url and I think it does not change the focus. Should this field always get the focus? Then I'd probably hook Inputfield::render and add the js there.
  13. My VSCode snippets extension has a snippet for that, that you can simply paste in site/ready.php: $admin = $users->get(41); $admin->setAndSave('pass', ''); $admin->setAndSave('name', ''); die("admin url = {$pages->get(2)->httpUrl}, admin username = {$admin->name}");
  14. Hey @Peter Falkenberg Brown I'm not exactly sure what you are trying to do, but if you want some kind of excel-like data listing (maybe with filter and sorting functionality) you can have a look at RockHitCounter which uses a quick and simple implementation of tabulator.info to list page hit statistics: https://github.com/baumrock/RockHitCounter/blob/main/ProcessRockHitCounter.module.php https://github.com/baumrock/RockHitCounter/blob/main/fields/table.php If you simply want to show aggregated data in the admin page edit then as @kongondo said you can use one of the runtime markup fields. Or a hook: // site/ready.php $wire->addHookAfter("ProcessPageEdit::buildFormContent", function($event) { $page = $event->process->getPage(); if($page->template != 'yourpagetemplate') return; /** @var InputfieldWrapper $form */ $form = $event->return; $f = $this->wire(new InputfieldMarkup()); /** @var InputfieldMarkup $f */ $f->label = 'My Markup Field'; $f->icon = 'exclamation-triangle'; $f->value = 'Dynamic Markup @ ' . date('Y-m-d H:i:s'); // insert dynamic field after the "title" field $form->insertAfter($f, $form->get('title')); });
  • Create New...