Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


horst last won the day on March 19

horst had the most liked content!

Community Reputation

5,129 Excellent

About horst

  • Rank
    observer of the big picture
  • Birthday 11/05/1955

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Aachen, Germany
  • Interests
    Photography; PHP, HTML, CSS (SASS,LESS), JS;

Recent Profile Visitors

33,680 profile views
  1. ... ...and show it visually! Following is a snippet, not a tutorial. But maybe it is useful for someone. Everyone knows the possibility to define a checkbox as required. However, a submit button would then visually execute the click movements and show the active color on hover. Depending on the status of the checkbox, you can either disable the functionality of the submit button via CSS ( pointer-events: none; ), or display a not-allowed cursor. But IMO, each of the two is asking for the other. If you embed the button in a wrapper element, you can marry both of them together. <fieldset class='gdprconsent'> <input type='checkbox' name='gdprconsent' id='gdprconsent' required='required' autocomplete='off' /> <label for='gdprconsent'>I agree to the privacy policy.</label> <div class='submitWrapper'> <input type='submit' name='submit' id='submit' value='Senden'> </div> </fieldset> #gdprconsent:not(:checked) ~ div.submitWrapper { cursor: not-allowed; } #gdprconsent:not(:checked) ~ div.submitWrapper > input[type='submit'] { pointer-events: none; } #gdprconsent:checked ~ div.submitWrapper > input[type='submit'] { cursor: pointer; }
  2. I don't think that there is a setting for only-for-superusers under CLI, as CLI itself only is for superusers. Maybe you can hook into error logging and fiddle that in?
  3. ,@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?
  4. 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 ?
  5. @ceberlin Many thanks for testing and providing feedback! 👍 Good to hear that you successfully switched 8 websites from v3 to v4.
  6. 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();
  7. $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.
  8. Ok, I found it. Here is something related to the topic:
  9. 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.
  10. 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.
  11. 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.
  12. 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).
  13. @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? ... }
  14. Thanks. Very nice template methods updates! Will come in handy! 🙂
  • Create New...