Jump to content

Recently Updated Topics

Showing topics posted in for the last 7 days.

This stream auto-updates

  1. Past hour
  2. So Canva seems to be shaping up to be a real challenge to Adobe in some ways after acquiring Affinity's design suite, and now Cavalry. I haven't tested Cavalry yet but I didn't think it had any web animation capabilities until I came across this beta web-player integration (?) Have any of you tried Cavalry? https://docs.cavalry.scenegroup.co/web-player/ It looks like it's available for free now. https://www.canva.com/newsroom/news/cavalry/
  3. Good day, @teppo! Good day everyone! As the topic says. If I throw new Wire404Exception(); in Wireframe controller, I expect a redirect to 404 page to happen. But an error message is shown instead. Is it a bug?
  4. Today
  5. In case it helps anyone, these are the settings I've been using for while which I believe make a huge difference to how it looks and its usability: And then in custom CSS section: :root { --pw-text-color: #444; --pw-muted-color: #999; --pw-button-radius: 10px; --pw-main-background: #fbfbfb; --pw-menu-item-background-hover: #EEEEEE; } html { font-size: 15px; } .PageList .PageListItem:hover { box-shadow: inset 0 0.5px 0 0 #ccc, inset 0 -0.5px 0 0 #ccc; } h1, .uk-h1 { font-size: 1.6rem; } .uk-card :is(a, .uk-link) { text-decoration: none; } .InputfieldHeaderHidden { --pw-border-color: transparent }
  6. Yesterday
  7. Version 1.1.2 Fix issue (https://github.com/neuerituale/ProcessCronJobs/issues/2) New `user` option to run a CronJob as a specific ProcessWire user. Support for different callback types: anonymous functions, object methods and static class methods.
  8. https://github.com/clipmagic/ProcessPromptManager @psy Thanx for sharing!
  9. Good morning @da² I have wrapped my head around your problem and I have found a possibility to check file uploads against the value of an input field by using a custom validation. In the following example you have 2 form fields: Field 1 is a text input where you have to enter the name of a file (for example "myfile") without the extension Field 2 is the file upload field where you upload a ZIP folder with different files. Validation check In this simple example it will be checked if there is a file with the filename entered in field1 present inside the files uploaded in field 2. In other words: Check if the uploaded ZIP folder contains a file with the filename for example "myfile" in this case. If yes, then the form submission is successful, otherwise an error will be shown at field 1. This is only a simple scenario to demonstrate how a custom validation could be done. You have to write your own validation rules. Now lets write some code for this example: The first one is the custom validation rule. Please add this code to your site/init.php. If this file does not exist, please create it first. <?php namespace ProcessWire; \Valitron\Validator::addRule('checkFilenameInZip', function ($field, $value, array $params) { $fieldName = $params[0]; // fieldname of the upload field $form = $params[1]; // grab the form object // get all the files from the given ZIP folder as an array $zipfiles = $form->getUploadedZipFilesForValidation($fieldName); // now start a validation rule with the value of this input field ($value) and the files inside the ZIP folder if (!is_null($zipfiles)) { $fileNames = []; foreach ($zipfiles as $zipfile) { $fileNames[] = pathinfo($zipfile, PATHINFO_FILENAME); } return in_array($value, $fileNames); } return true; }, 'must be a wrong filename. The ZIP folder does not contain a file with the given name.'); I have named the validation rule "checkFilenameInZip" in this case. The important thing is that you have to add 2 values to the $params variable: The name of the file upload field The form object itself To get all the files that were uploaded via the upload field, you can use one of these methods of the form object. getUploadedZipFilesForValidation (outputs only files of a ZIP file) getUploadedFilesForValidation (outputs all files of a file upload field) Important: To use these 2 new methods you have to update to the latest version of FrontendForms (2.3.14)! All ZIP files will be extracted automatically. Nested ZIP files are supported too. Now lets create the form $form = new \FrontendForms\Form('testform'); $form->setMaxAttempts(0); // set 0 for DEV $form->setMaxTime(0); // set 0 for DEV $form->setMinTime(0); // set 0 for DEV $form->useAjax(false); // set false for DEV // input field containing a filename $filename = new \FrontendForms\InputText('filename'); $filename->setLabel('Name of file'); $filename->setNotes('Please enter the name of the file without extension.'); $filename->setRule('required'); $filename->setRule('checkFilenameInZip', 'fileupload1', $form);// here is the new custom validation rule: Enter the name of the file upload field as the first parameter and the form object as the second parameter $form->add($filename); // the file upload field $file1 = new \FrontendForms\InputFile('fileupload1'); $file1->setRule('required'); $file1->setLabel('Multiple files upload'); $form->add($file1); $button = new \FrontendForms\Button('submit'); $button->setAttribute('value', 'Send'); $form->add($button); if ($form->isValid()) { // do what you want // $extractedFiles = $form->getUploadedFiles(true); // returns all uploaded files including extracted ZIP folder files // $nonExtractedFiles = $form->getUploadedFiles(); // returns all uploaded files but Zip files are not extracted // $values = $form->getValues(); // returns all submitted form values } echo $form->render(); Copy this code and paste it inside a template for testing purposes. Upload a ZIP folder and add the name of a file inside the "filename" input field. If the file exists in your ZIP folder you will succeed. Please note: The extraction of the ZIP files is done only once during the validation process. You can get the extracted files afterwards inside the isValid() method via the getUploadedFiles() method from the temporary upload folder. Use the return of this method to do some more work with the uploaded files. Take this example as a starting point for your own validation rules and let me know if it works for you. I think this is the only possibility to get what you need. Another hint: User browser validation in FrontendForms to make client side validation first by enabling it in the backend.
  10. Last week
  11. 50 Templates + 14 Repeaters 🙂
  12. I'll see if I have time to do a full case study. The map is easily explained though: Since Switzerland is a very small country, stretching it onto a 2D plane can be done without much distortion. That's where the LV03 and LV95 coordinate systems come into play. They are centered at the observatorium of the ExWi building of the University of Bern (where I studied CS :P). From there, you count the meters to the north and the east (and add some offsets so there are no negative coordinates). Using Switzerland's official map service, you can easily come up with LV95 coordinates for any address. These are then added to the locations in the PW admin. The map thus is just an SVG and placing the dots is just simple LV95 coordinate to pixels interpolation. No external services needed, no privacy concerns.
  13. Shocking stuff. Perhaps a good title would be Another great reason not to use WordPress. 🙂 In PW world, how many of us run Module updates through any audit before installing?
  14. I wasn't realy planning to, we'll see! R
  15. You can try to compare the Textarea field settings. I have seen this behaviour when the editor setting uses a faulty js / css file path. Maybe a custom JSON file have been moved.
  16. Very useful, indeed! May I suggest an example in its docs for the developer to implement: - A URL segment `/md/` or, even better, adding `.md` to the URL to trigger the display of the markdown version of the page?
  17. 😂 https://www.tomshardware.com/tech-industry/artificial-intelligence/claude-code-deletes-developers-production-setup-including-its-database-and-snapshots-2-5-years-of-records-were-nuked-in-an-instant EDIT, the post-mortem by the developer: https://alexeyondata.substack.com/p/how-i-dropped-our-production-database
  18. I presume, then, if you know it's not animated and you want the webp version you can use ->webp. It's probably good as it is in hindsight.
  19. @wbmnfktr thanks, 2 issues fixed. The last one was not a syntax the module supports (method syntax rather than property syntax) but added support for it in the latest commits with PW's call unknown() method catchall.
  20. Trying that out (using $pages->get("/home/landing")->introimg_field instead of $item->introimg_field) : <?php foreach($pages->get("/home/landing")->introimg_field as $intro_image): ?> <a href="<?php echo $intro_image->page_picker->url; ?>"> <h3><?php echo $intro_image->title; ?></h3> <img src="<?php echo $intro_image->image->url; ?>" alt="<?php echo $intro_image->description; ?>"> </a> <?php endforeach; ?> It shows up in Firefox, but not in Edge. If I revert back to $item->introimg_field, it keeps working. For now.
  21. dragan

    I'm back

    @Soma Welcome back!
  22. I'm thinking a stand-alone repo? If it's going to be a solid design language reference and referenced by other modules and developers, it should be separate. What's your feeling?
  23. I was just thinking this when @Soma reappeared. I've been using MSN too on every project I've ever created and never had an issue with it.
  24. I heard that too. If I’m not mistaken though, you can have 10,000 views per month free. https://mapsplatform.google.com/lp/maps-apis/#pricing
  25. Wow. This is incredible. Thank you for how thorough it appears to be.
  26. Fantastic, thanks Robin.
  27. @maximus, thank you for all the modules! Just to let you know: there are 2 occurences of formatBytes() in Context.module.php
  28. PromptWire MCP (new name) is now public on Guthub. Use at own risk 😀 https://github.com/PeterKnightDigital/PromptWire-MCP PromptWire MCP for ProcessWire (blog introduction) Documentation can be found here. https://www.peterknight.digital/docs/promptwire/v1/ Enjoy 😊
  29. Quick update — pushed v1.3.0 today. Added dark mode support (all colors follow AdminThemeUikit CSS variables automatically) and interactive filtering: click any row in Pages, Sources, Geography, Devices, or Browsers to filter all widgets at once. Active filters show as removable tags at the top of the dashboard and are stored in the URL. Thanks @bernhard GitHub: https://github.com/mxmsmnv/PlausibleAnalytics
  1. Load more activity
×
×
  • Create New...