-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
If you, for what ever reason, need to present a link to a static *.ics file for download, you can add this line to the servers .htaccess file instead have to send http headers: AddType text/calendar .ics
-
How far back in time are threads relevant to today's PW?
horst replied to Jared's topic in General Support
I just deleted my post while the post from @szabesz chimed in, and he has written it in a more structured way then what I had done. So, nothing to add from me here. @Jared Welcome to the forums. ? -
I cannot see any place where you want to load the mentioned js scripts. But I spotted something in your js file, the only one that gets loaded (http://www.permaculturaorganica.info/site/templates/styles/assets/js/po-home.js). There you use a bunch of bg-images with relative (sub) pathes. Have you tried to use absolute URLs instead? // Slideshow Background. (function() { // Settings. var settings = { // Images (in the format of 'url': 'alignment'). images: { 'styles/assets/img/sfondi/po-index/bg0.jpg': 'center', 'styles/assets/img/sfondi/po-index/bg1.jpg': 'center', ... the above with absolute URLs for the images: // Images (in the format of 'url': 'alignment'). images: { '/site/templates/styles/assets/img/sfondi/po-index/bg0.jpg': 'center', '/site/templates/styles/assets/img/sfondi/po-index/bg1.jpg': 'center', ...
-
1054 Unknown column field_fieldname.filedata in field list
horst replied to Klenkes's topic in General Support
Follow the suggestion in the post above yours. (The link into the other thread) -
... ...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='Submit'> </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; }
-
Suppressing “command line API” error messages (AJAX/XHR)
horst replied to Jan Romero's topic in API & Templates
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? -
,@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?
-
Show username on frontend who insert a repeater item
horst replied to astock's topic in API & Templates
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 ? -
@ceberlin Many thanks for testing and providing feedback! ? Good to hear that you successfully switched 8 websites from v3 to v4.
-
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();
-
$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.
-
Ok, I found it. Here is something related to the topic:
-
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.
-
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.
-
Using value of editable_pages from PageEditPerUser module in API selector
horst replied to Tyssen's topic in API & Templates
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. -
Changing default language in existing website
horst replied to Inxentas's topic in Multi-Language Support
This seems to be working: -
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).
-
@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? ... }
-
Thanks. Very nice template methods updates! Will come in handy! ?
-
module Cache Control - Clear all your caches in one place
horst replied to MoritzLost's topic in Modules/Plugins
? -
@LMD CroppableImage maybe?
-
module Cache Control - Clear all your caches in one place
horst replied to MoritzLost's topic in Modules/Plugins
@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. -
@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.??
-
module Cache Control - Clear all your caches in one place
horst replied to MoritzLost's topic in Modules/Plugins
@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. -
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.)