Leaderboard
Popular Content
Showing content with the highest reputation on 04/08/2019 in all areas
-
First part... A quick test (ProcessWire 3.0.123 and FI 1.0.0) where I exactly did what you described and... it worked as expected. Added FI language pack to default Logout / Login Admin in finnisch Deleted all language files in default Logout / Login Admin in english again There were no mixed translations in the backend at all. Please try to log out and log in again. That sometimes helps with language hiccups. Or even clear browser cache including cookies / try another browser. Second part... Have had the same feelings about language handling at the beginning. But after ~20 multi-lang installations and lots of hours playing around with it my feelings changed. Works ~95% of the time I need it. Never had any real issues with it. WordPress: total fail Drupal: maybe it changed but a few years back it was quite painful Typo3: never seen a multilanguage setup that worked well Textpattern: mh... nope Silverstripe: can't really remember if it worked that well To be honest... I'm super biased in terms of ProcessWire as it gave me so much options and kind of freedom in the past to get almost everything done right from the start. But nonetheless I can't remember any real issues with multi-language setups, neither in front-end, nor in the backend.6 points
-
3 points
-
<picture> <img src="<?= $image->width(400)->url ?>" alt="<?= $image->description ?>" sizes="(min-width: 640px) 60vw, 100vw" srcset="<?= $image->width(200)->url ?> 200w, <?= $image->width(400)->url ?> 400w, <?= $image->width(800)->url ?> 800w, <?= $image->width(1200)->url ?> 1200w, <?= $image->width(1600)->url ?> 1600w, <?= $image->width(2000)->url ?> 2000w"> </picture> What's wrong with doing it like that? You won't need to care about the naming of any files at all. You can also automate that even more to have customizable sizes for the images. For the webp topic I have to say I'm not up to speed on horsts work, so I'm not sure how to handle that.3 points
-
Would be great to either enable multi-sort for pages in the admin or to be able to set an initial sort order to apply before Manual Drag and Drop. The main goal is for new pages to be added to the top of page listings in the tree when Manual sort is enabled. There are a lot of historical posts about this in the forums, and I keep hitting this hurdle when I try to migrate clients from other CMS to PW. It is actually almost a dealbreaker for them wanting to use PW. I have never actually had a job where it was possible to sort by date created / published by itself. For example I do a lot of sites for creative clients who have listings of "projects" and want the admin to look like the front-end (most recent first), but like to retain the ablility to tweak the order of their latest jobs. Thanks!2 points
-
Microsoft Edge arrived in its Chromium-flavour version. For those who want to give it a try already. Right now you can download the DEV (weekly updates) and CANARY (daily updates) versions. https://www.microsoftedgeinsider.com/en-us/download/ Windows 10 needed. Windows 8.1/8/7 and macOS will follow soon.2 points
-
https://github.com/rolandtoth/AdminOnSteroids/wiki/AddNewChildFirst2 points
-
Even if the compressed size does not differ much, don't forget that images need to be decompressed on client side in order to get displayed. Devices with ram limitations may fail to hold too much image data in memory and either fails to display the image completely or need to decompress whenever the viewport requires to render the image. Edit: The larger screenshot has a resolution of 1000x679 pixels, if images are decompressed into 32 Bits (RGBA), the footprint on client side is about 20MBytes, the smaller one with 628x426 only occupies 8MBytes. I wouldn't bother about client resizing for few of such images per page as well, but if your pages may contain more pictures (like a thumbnail gallery), I'd really consider to deliver smaller versions.1 point
-
Eureka! ? Read in some post that it was supported, hence some loss of hair. Thanks!1 point
-
Page names have to be unique (if they share the same parent). If you create a new page with an already existing page-name, PW will append an integer. If you clone a page, it will add " (copy)" to the title, and also an auto-increment number to the page name. This happens both when you use the API or GUI. Maybe that's the problem here? You could check with slightly altering the selector for page name: name%= instead of name=1 point
-
You could show us some titles to test it out. Did you read about how to work with the second argument there ? https://processwire.com/api/ref/sanitizer/page-name/1 point
-
No... it always depends on the project and website. But there are a few things I don't want to miss. Those are: SSL/https with Let's encrypt SSD webspace because it's faster Admin panels like cPanel are nice but not necessary SFTP/SSH is a benefit Cron of any flavour is highly appreciated GDPR compliance in terms of data-processing-agreements (or however they are called) A good reputation (4.5+ ratings) A good website with all relevant details (Imprint, Privacy, GDPR) A good website that's not powered by a WordPress theme More than 5 years in business Servers in my home country Free or local support hotlines + the things mentioned above Yes... It's more about the company than the webhosting itself but these things are as important as everything else. Maybe even more. Nope... never did anything like that with a ProcessWire project. FileZilla is S/FTP so about 99% of all webhosting companies should fit here. ? I prefer Site Profile Exporter as I create a full copy of everything with only a few clicks. I know others here that prefer Duplicator. So... try everything and decide which way to go. Regarding sync-scripts of any kind... not mine at all. As said before... it really depends on your needs. I never used webp support in a live project so far and therefore never had the need of special modules. But yes... put it on your checklist and later on ask hosting companies if they support those features.1 point
-
Hi, I can't get csv import to work for a ProField Multiplier. I have 14 columns/fields paired. The multiplier field is number 6. If mapped I get the import to work for all fields up until this field (no errors shown) this field and the following are empty. If I remove the mapping for this field everything else get's imported correctly. Is the syntax for CSV Field Pairing different when using multiplier? The field name is pm_numbers and I mapped like this: 1:title . . 6:pm_numbers Most rows of the CSV has a single value the ones with more than one have them separated by a pipe | Type is text but actually contains numbers in the CSV but that shouldn't matter right? Any clues?1 point
-
Nope, nothing like that. I never understood that nonsense with hardcoding full URLs into the DB. You might adjust a few lines in your site/config.php (allowed domains whitelist, disable debug-mode, change DB-credentials etc.), but that's about it.1 point
-
As I've mentioned svelte already and the filesize argument was used: https://v3.svelte.technology/repl?version=3.0.0-beta.22&example=onmount This example downloaded and compiled results in a 4kb javascript bundle. I'm quite sure even just the code using jquery would need about half of that size to do the same excluding jquery itself. So there are more modern ways to have the benefits of a nice view library in javascript without the need for bloated runtime library code. Svelte has a tiny runtime library, which can even be tree shaken (only include what's needed), while the heavy lifting is done at once at compile time. The better part of your file size bundle will only consist of the actual stuff you build using it. It's only sad that it's currently in a "please don't start using v2 anymore, but also wait till v3 is done" phase.1 point
-
Can't you just return? $this->wire()->addHookBefore('WireHttp::send', $this, 'functionName'); public function functionName($event) { if ($something === true) { return; } // continue }1 point
-
I think, you might replace the entire hook then; https://processwire.com/docs/modules/hooks/#how-can-my-hook-replace-another-method-entirely1 point
-
Hi you might call it dumb, but this is actually interesting, I was thinking is there any mechanism to /condition to stop a Hook from being called, so pardon this jargon, so I took the time to see if such exists public function runHooks($method, $arguments, $type = 'method') { $result = array( 'return' => null, 'numHooksRun' => 0, 'methodExists' => false, 'replace' => false, ); $realMethod = "___$method"; if($type == 'method') $result['methodExists'] = method_exists($this, $realMethod); if(!$result['methodExists'] && !self::isHooked($method . ($type == 'method' ? '()' : ''))) { return $result; // The condition for not running is when not hooked or method doesn't exist } $hooks = $this->getHooks($method); foreach(array('before', 'after') as $when) { if($type === 'method' && $when === 'after' && $result['replace'] !== true) { if($result['methodExists']) { $result['return'] = call_user_func_array(array($this, $realMethod), $arguments); } else { $result['return'] = null; } } foreach($hooks as $priority => $hook) { if(!$hook['options'][$when]) continue; if(!empty($hook['options']['objMatch'])) { $objMatch = $hook['options']['objMatch']; // object match comparison to determine at runtime whether to execute the hook if(is_object($objMatch)) { if(!$objMatch->matches($this)) continue; } else { if(((string) $this) != $objMatch) continue; } } if($type == 'method' && !empty($hook['options']['argMatch'])) { // argument comparison to determine at runtime whether to execute the hook $argMatches = $hook['options']['argMatch']; $matches = true; foreach($argMatches as $argKey => $argMatch) { $argVal = isset($arguments[$argKey]) ? $arguments[$argKey] : null; if(is_object($argMatch)) { // Selectors object if(is_object($argVal)) { $matches = $argMatch->matches($argVal); } else { // we don't work with non-object here $matches = false; } } else { if(is_array($argVal)) { // match any array element $matches = in_array($argMatch, $argVal); } else { // exact string match $matches = $argMatch == $argVal; } } if(!$matches) break; } if(!$matches) continue; // don't run hook } $event = new HookEvent(); $event->object = $this; $event->method = $method; $event->arguments = $arguments; $event->when = $when; $event->return = $result['return']; $event->id = $hook['id']; $event->options = $hook['options']; $toObject = $hook['toObject']; $toMethod = $hook['toMethod']; if(is_null($toObject)) $toMethod($event); else $toObject->$toMethod($event); $result['numHooksRun']++; if($when == 'before') { $arguments = $event->arguments; $result['replace'] = $event->replace === true || $result['replace'] === true; if($result['replace']) $result['return'] = $event->return; } if($when == 'after') $result['return'] = $event->return; } } return $result; } As you can see there isn't any logic to stop hooks from running other than if the arguments are wrong and method doesn't exist or the method itself in question is not hookable. However using an exit should work since the exit method stop the execution of the current script. I think the concept of Hooks is you attaching to them and not stopping them. But another alternative would be to remove the check from the hook and and have the check determining whether to call the WireHttp::send Let me know if that suffices1 point
-
High Performance Browser Networking © Ilya Grigorik the complete book is online now for free reading: https://hpbn.co/1 point
-
It's not as foolproof as you might think it is. https://hackernoon.com/why-you-should-never-save-passwords-on-chrome-or-firefox-96b770cfd0d01 point
-
1 point
-
@RicknRoller, did you check the server response for these damaged images? Its always 42 bytes for exactly this string: This is intentionally invalid image data. Since the server replies with 200 I guess this is the content of the converted image file (you may want to check the folder /site/assets/files/2361/ for example). If the file on your server is correct, then I'd check nginx, if the file contains this string, there is an issue with image conversion for some reason. Sounds like some sort of shareware limitation...1 point
-
Thanks @horst & @szabesz. I wouldn't want to install Admin on Steroids just for this, I actually use your module @horst https://modules.processwire.com/modules/page-tree-add-new-childs-reverse/ but personally I think this kind of thing should be in core. Why not multi-sort? Or at least a site-wide config flag to change default page tree sort from ascending to descending. This is a hurdle I hit every project, and I remember initially when using ProcessWire it was a roadblock until I discovered the modules to fix. It is more developers that are coming from other CMS that I am thinking of.1 point
-
So serve the original rather than a variation then. It's totally up to you and what you write in your template code - PW doesn't compel you to load anything on the front-end.1 point
-
Yes, if you need this on multiple differend hosts, - or as learning lesson. ? Otherwise, when only needed once, you are good to go with your custom code in a template or function.1 point
-
Oops I get the confusion now, sorry my fault I assumed it was the same when i saw horst name here is the link:1 point
-
This is possible by 3party module AOS, Admin On Steroids. (On mobile, so please search in the modules directory or the modules forum for it. Author is @tpr)1 point
-
yeah for selecting icons there is a version of FieldtypeFontIconPicker floating around somewhere (possibly not the one in the directory) that works really well, will gave to dig that one up.. Edit - this is the one i use for icons, thanks to @OLSA1 point
-
Agreed. I think that perhaps the best solution is for you to maintain the module, integrating anything applicable from my version. I’d be happy to help with this process.1 point
-
Nice module. You should add this: $embedCode = utf8_encode($data['html']); When fetching data from providers, and set the data tables to mb4. Otherwise the output gets chewed up and throws errors. Test with instagram embed where there is an emoji in the title, e.g. https://www.instagram.com/p/BjXM8mInfN-/ Thanks for the module.1 point
-
You can always reset your password just by pasting this temporarily into any one of your templates, and then viewing a page that uses the template: $u = $users->get('admin'); // or whatever your username is $u->of(false); $u->pass = 'your-new-password'; $u->save();1 point