-
Posts
687 -
Joined
-
Last visited
-
Days Won
4
Everything posted by matjazp
-
I'm no expert in multilanguage, done exactly one site, so I can't give any advice. But my primary site is dual language, slovene primary, english being the second, and all that belongs to english language is under /en/ in my page structure. I have different structure, menu, pages, assets etc. Why I did it that way? Because you have all the freedom (or at least I believed so 3-4 years back when I made the site). I guess this is not a path you could take now.
-
Would this work? $options = array('keepTags' => array('h2'), 'underlineHeadlines' => false, 'stripTags' => false); d ($sanitizer->truncate("<h2>header</h2><p>test1 test2 test3</p>", 30, $options)); "<h2>header</h2>test1 test2…" (29)
-
Yeah, your' right, it calls collapse() that in turn calls markupToText() but with own options. Would it help if you try keepTags/keepFormatTags option?
-
Try (untested): $text = wire('sanitizer')->truncate($item->body, 200, array('underlineHeadlines' => false));
-
Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
matjazp replied to David Karich's topic in Modules/Plugins
I'm using it in a production (PW 3.0.104) for years, I thinks in it's basic (original) version, no problem so far. I'm not merging multiple js/css with AIOM, I do it by hand. Give it a try, you may even want to try my forked version, and if it doesn't work for you, the solution is ProCache. If the client have no money, then it's ok, PW will work out of the box too. And, nowadays internet connections are fast enough so that minimizing for every cost is not so important (that's my opinion). -
Yeah. Maybe simple text like "80% smaller" or "20% larger" would make more sense. Or maybe no info at all. I'm also confused with the word "Original"...
-
Is it just me who don't understand the percentage for the webp generated variation? Original is 311k, webp is 62k, how do I get 80% ? That means webp is 80% smaller than original? And if webp is bigger than original, I get (webp -20%). And while here, how do I delete webp variation?
-
I'm getting this error too but it doesn't go away. I had to change static public function getModuleConfigInputfields(array $data) to public function getModuleConfigInputfields($data)
-
webp support is added in PW 3.0.132
-
What's your PW version?
-
@ryan @dragan I can confirm the problem is in AOS. It's an easy fix for @tpr.
-
I can confirm. It looks like processInput is not executed if Yes is checked.
-
That error comes from ProcessFileEdit.js when file is saved. I'm testing on PW 3.0.140 and its saving. Any hints in browser dev console? Could you try reverting .htaccess file back to the working version?
-
Change how many page numbers to show between ellipses in pager
matjazp replied to thetuningspoon's topic in API & Templates
-
Change how many page numbers to show between ellipses in pager
matjazp replied to thetuningspoon's topic in API & Templates
@thetuningspoon mind testing with attached PagerNav.php? Possibly not perfect, but it's not clear to me how pagination should be presented on edge cases... PagerNav.php -
Please try this version, check the box under advanced options. AutoSmush.zip
-
I usually decide if I want to keep exif or not when the image is prepared for upload. But I see your point. It's possible to add an option, but I'm quite busy these days and then I'm off to a vacation... I'm not sure if this module has a potential now that we have webp?
-
Hm, the intended purpose for the image (regardless of the format) is to be displayed on the screen, no? How is webp different in that context? Noted.
-
Why not? Why is webp treated only as variation and not as other "normal" image? I added this to /site/config.php: $config->hasWebpSupport = (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false); $config->imageSizerOptions = array_merge($config->imageSizerOptions, array( 'webpAdd' => true )); And in my template: $img = $page->images->first(); $url = ($config->hasWebpSupport && $img->hasWebp) ? "urlWebp" : "url"; echo "<a href='{$img->$url}'>{$img->$url}</a>"; // this is actually php implementation of .htaccess rules Then I uploaded image.jpg and found out that webp is generated only for admin thumbs and not for my uploaded image. I don't want to call size() as my uploaded image is already the way I wanted, I just need webp. Is this unsupported situation? Why do we need webp as admin thumb? I added: $config->adminThumbOptions = array_merge($config->adminThumbOptions, array( 'webpAdd' => false )); and that fixed admin thumb webp creation, but of course there is no webp image. I then manually copied image.webp to the folder where image.jpg was uploaded and this time the image was correctly displayed in Chrome (that has webp support) and in IE (that lacks webp support). Maybe you could add another property to the image that would return the correct URL as in my template file? Should webp extension be listed in /wire/config.php on $config->fileContentTypes?
-
Maybe the most reliable way is: $webpsupport = (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false); if($webpsupport) { //serve webp } else { //serve jpg or png or whatever } Of course, .htaccess is a viable solution...
-
Yes, there are [OR] conditions in htaccess.txt, but they are all [OR], not a mixture of [OR] and [AND]. I understand that, but how would .htacces know if image.webp is "made" from image.png or image.jpg? How would you decide which one is first? Also, when I upload image.webp I get "Pageimage: castle.0x260.webp - not a supported image type"
-
I can't make this work on IIS as I don't know if mixed conditions are supported, as far as I know, you can either MatchAny or MatchAll. It will work If I omit the last rule and use MatchAny (IIS fans?). But, how would we know what to serve to the browser if webp is either unsupported or doesn't exist, .jpg or .png or even something else?
-
It's working here on Windows and IIS 8.5