Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by horst

  1. ,@neophron, I think this module and the service behind it has nothing to do with what was called "quality loss" in the above posts. It is a good method to compress your (final) png image variations to get smaller filesizes. But maybe nowadays you can use WebP format directly in PWs core, instead to stick with png output, and than having to invoke a remote service?
  2. Somewhere in your template code you loop through your repeater items. There you have each of them as a Page, but with your own given name. This $variableWithYourCustomName is a PageObject and has all the properties and methods that you know from the global $page variable, that holds the current page. Have you tried $yourNameForRepeateritem->createdUser ?
  3. @ceberlin Many thanks for testing and providing feedback! 👍 Good to hear that you successfully switched 8 websites from v3 to v4.
  4. I now have played with Custom Page Classes too. I successfully have created a cascading hierarchy for a sort of mvc system of mine: I make massive use of templates, where most of them are simple clones. I do this to have bullet-proofed identification of specific pages, but give the clients the opportunity to change title, name, and also the ID, if he once deleted a specific page and created a new one. (Template family is set to onlyOne!) All the public viewable pages are set to the same template filename (basic-page), which previously was my controller file with all the rendering stuff. Now it's content is reduced to 4 lines only, and all render stuff is included into custom page classes, whereas it now is much cleaner to read and follow compared to before, because now I can overwrite the basic render method in custom page classes for specific pages. I created a BasicPagePage as base: <?php namespace ProcessWire; class BasicPagePage extends Page { public function renderSections() { // ... } } This one is used from all other public pages and extended only where needed: <?php namespace ProcessWire; if(!class_exists('ProcessWire\BasicPagePage')) require_once(__DIR__ . '/BasicPagePage.php'); class LegalpagePage extends BasicPagePage { public function renderSections() { // override parent method here, if needed } } Here is a debug list of a few pages The basic-page.php controller now: <?php namespace ProcessWire; // load header with navbar and footer with links, hamburger, scroll-to-top item, etc. include(__DIR__ . '/includes/_header.php'); include(__DIR__ . '/includes/_footer.php'); include(__DIR__ . '/includes/_absolute-positioned-elements.php'); // call method in CustomPageClasses to render all public viewable sections of the current page $page->renderSections();
  5. $options = ["forceEngine" => "ImageSizerEngineGD", "forceNew" => true]; // also add forceNew = true while testing !! $pageimage->size(100, 200, $options); I think it should be this. But not 100% sure if the spelling is correct.
  6. Ok, I found it. Here is something related to the topic:
  7. I have seen something like this in the past. It looks like the source image is not clean clipped. You may open it in photoshop and hover over the first pixel beneath the object. I bet it has color 255,255,255 but with opacity. Otherwise IMagick would take the gray color value of the shadow. If you have this as photoshop layers, please check the clipping of the object(s) and maybe correct it. Also a good thing is to add some monochrome noise to the shadows only. Also you may try setting "defaultGamma" => -1, in $config->imageSizerOptions in the site/config.php. And try with forceEngine GD, just to see how it works out in comparison to IMagick. But I'm sure that the issue belongs to the above explained somehow unclean clipping of the objects.
  8. Yes, without the need to enlarge the images on the bottom side, this would be a perfect use. But I needed a smooth transition from bottom black to transparent, without a visible hard line where the added bottom space touches the image. I couldn't figure out a css only solution that combines all needed parts. Also the current browser support isn't good, and I would have to use filter with additional layer divs instead of backdrop-filter.
  9. Maybe your $ap is a pageArray and not a single page? Maybe you test this better with var_dump($ap), as you seems to be in scope of template files, it will out strings / numbers, but it is a pageArray. Check this, or check with echo count($ap); or echo $ap->first(); to see if it is a number or an array.
  10. Just to clarify: the png format has no quality loss. But the GD lib has massive issues in resizing dark image parts. With such dark images, you must set the imagesizer defaultGamma option to -1 !! If your server supports imagick, you can activate the ImageSizerEngineIMagick, that is part of processwires core. (Under modules core).
  11. @chrizz If you want to create a page but it already exists, than you cannot create it. So you first simply need to check if there is one or not: $title = "mytitle"; $pagename = $this->sanitizer->pageName($title); $parent = $pages->get("/styleguide/"); if(0 == $pages->get("parent.id={$parent->id}, name={$pagename}")->id) { // the selector also can check for parent and title, instead of parent and name // no page with that name exists here, so create it here $channel = new Page(); $channel->template = "basic-page"; $channel->parent = $parent; $channel->title = $title; $channel->name = $pagename; $channel->save(); } else { // A page with that name is already there, what to do now? Throw an exception? Drink a beer? ... }
  12. Thanks. Very nice template methods updates! Will come in handy! 🙂
  13. @LMD CroppableImage maybe?
  14. @MoritzLost I think it is "the best way!" to use (guest) HTTP requests to warm up a ProCache. Thats why I really like the use of this crawler tool. It starts at the homepage, determine links to the homepages childpages, fetch and parse them, and so on. I think the real problem is to get all "real public URLs" from within PW, as I have sites that use many many pages that have a public state, but in real they are only single sections of a page. So, maybe thats my private problem, but I'm not sure if there is a way to detect which pages / parent pages are official / public URLs. I think if a warmup function can get passed a optional URL list or a PageArray, that overwrites a default behavior, this would be a great benefit for all out there, that uses MVC and other individual approaches.
  15. @Mats I downloaded and installed the latest PW dev version with a blank profile, added the CAI4 module, created a new image filed and saved a crop setting "square,200,200" successfully. Everything in this regard is working fine here. I can't reproduce! Also nothing in regard of the cropsettings inputfield and its processing have changed, compared to the other versions that are in use for many years.??
  16. @MoritzLost A warmUp cache is definetly on the wishlist of some of us. This came up from time to time in forum posts. But with ProCache and larger sites it definetly is not trivial. For smaller sites I have build some individual (hacky) solutions to drop and rebuild the ProCache pages, but for larger sites I manually use a local program that traverses a given website and collect information about broken links, redirects, etc. I'm not sure how big the effort will / must be. I do know some sites (where I use my local tool) that have large archive content, that never will change. My PC time cache limit there is one year! It also could be infinite.
  17. You mean, you cannot save a crop setting, only other field settings? So your cropsettings inputfield stays empty all the time? Which PW version? (I will try to reproduce.)
  18. @Mats, please can you verify that you are using the latest version of CAI3 that is: 1.2.0 ?? If you have used an automated update service, it potentially stuck with version 1.1.18. I now manually updated the record in the modules directory to 1.2.0!
  19. Hey Mats, thanks for testing. I tested saving of different Crop Settings and also edited and or removed them later without issues. So, cannot reproduce. Have you tested it locally or on a online server? Have you used CAI4 alone, or is CAI3 also installed there when you tested? You mean, you are not able to store any settings, never? Or occurred the issue occasionally?
  20. I successfully tested it on one site several times (ca. 10x) with ProCaches between 50 and 700 pages! 🙂 Nice work!
  21. Hey, I've made good progress. I think I have solved the issue for updating / changing from CAI3 to CAI4! 🙂 - So, if you want to use a CroppableImage field for a fresh new site, simply go directly with CroppableImage4! (once it is officially released) - And if you have the CroppableImage3 on an existing site, but want to upgrade to CroppableImage4, (because you need WebP support), follow these easy steps: First update CroppableImage3 to the latest version 1.2.0! After that, additionally install CroppableImage4. Now you can use both modules with the same ->getCrop() method call on pageimages. The getCrop hook "knows" from which field and module version it comes. 🙂 Therefore, from now on, you are free to start using CAI4 for new created template calls to CAI4 fields, while the older CAI3 calls can stay in and are fully functional without any changes. If you want to switch CAI3 fields to CAI4 fields, to benefit from the new functionalities, you can do that in the admin > setup > fields > YOURFIELDNAME editor, by changing the (field) type. (see screenshot beneath, & yes, KEEP SETTINGS!) The only thing you have to check, before doing that, is: looking into your templates code, if you have made use of the optional second param in the old CAI3 ->getCrop() calls. If no, what I think is 99.9% the case, you have to do nothing. If you make use of it, you need to change / adapt your method call in the template file. That's it. Summary: update CAI3 install CAI4 change the fieldtype(s) from CAI3 to CAI4 When I've got some feedback from beta testers (and everything works out as expected) I will release the CAI4 through the modules directory. Until then, you get the RC2 version of it on GitHub: https://github.com/horst-n/CroppableImage4
  22. - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - There is a new Version in the pipe, that supports WebP too: - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + -
  23. Hi @Pete, thanks for the warm words. And yep, the times without web fonts was way more challenging in regards to satisfy designers dreams. Especialy when working with designers coming from print media. 😁
  • Create New...