Leaderboard
Popular Content
Showing content with the highest reputation on 08/07/2016 in all areas
-
I just want to write how much I feel welcomed in this community. I came for the tech, but stay for the community. Just wanted to say how awesome are you guys and gals here at the PW community. long live PW and the jolly folks at its community20 points
-
You can do a $modules->isInstalled("ModuleClassName") check in the template file and do your own error / notification handling.5 points
-
4 points
-
Just wanted to add that if, as in the OP's case, you are going to foreach the children then there is no additional penalty to using $page->children()->count() because you will be loading the children into memory anyway.2 points
-
This is a very beta version of the separate functions I use to generate srcset/bgset markups. There's some similar functions floating around in the forum but this one is a bit different because you can set "named image sets" which you can use easily site-wide. It's definitely work-in-progress so use it at your own risk. MarkupSrcSet Generate srcset and bgset markup for lazysizes. Features generate srcset/bgset markup for lazysizes set image sizes in JSON array add required JavaScripts automatically (optional) fallback to smallest image size if JavaScript is not available Usage Image sets JSON (in module settings): { "hero": [ [640, 210], [1080, null], [1920, null] ], "featured-image": [ [360, 240], 1.333, 2.667 ], "gallery-thumb": [ [240, 120], [480, 300], [800, 576] ] } Image methods $image->srcset(): <img <?php echo $page->featured_image->srcset('featured-image'); ?>> $image->bgset(): <div <?php echo $page->images->first()->bgset('hero'); ?>>Lorem ipsum</div> https://github.com/rolandtoth/MarkupSrcSet1 point
-
I've just added a pull request for a ProcessWire driver to laravel valet: https://github.com/laravel/valet/pull/55/files For anyone wanting to have a quick local dev environment (on a mac) you should certainly take a look. https://laravel.com/docs/master/valet1 point
-
I just added a new Metadata section to the Mail panel, as well as linking the attachments so you can easily check them. Note that the Metadata section has currently only been tested with @horst's WireMailSmtp module. Please let me know if you have any problems/requests for use with wireMail's default use of PHP's mail() function, or @teppo's SwiftMailer module.1 point
-
As for now I allowed clicking on the fieldname that slides in to edit the field. It opens by default in new tab (configurable to open in panel or modal). I'll keep the ctrl-click option too. (AOS's ctrl+s is addictive. I find myself more and more trying to save my comments here that way :))1 point
-
1 point
-
@fuzendesign - looks like your issue has already been reported: https://github.com/ryancramerdesign/ProcessWire/issues/19651 point
-
Sorry if this is the wrong place to post this, but I’m getting the following error after updating to 3.0.29. Error: Call to a member function add() on null (line 629 of …/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module) This error happens in these cases: When trying to edit pages created prior to the 3.0.29 update. It happens **after** step 1 when creating a **new** page. By step 1 I'm referring to the initial create page screen where we assign a Title to a page. Submitting that page throws no errors, but an error is thrown when trying to save on step 2 (where we fill in all other fields). It happens when deleting a page.1 point
-
I see your points about clicks/icons etc but I'm still not convinced which would be the best way. I also see the issue with System Notifications. I'll see what can I do, I hope there will be an easy fix.1 point
-
Hi all, I'm going to be away for the next couple of weeks (4-5 weeks possibly) with little if any access to the internet. I will deal with any queries on my return. Thanks1 point
-
I tried Chrome's "Empty Cache and Hard reload", Incognito and another browser too. Maybe not the best, but with a _blank target it should do. I support the icon idea too, that is something obvious and normally we have enough room for it, I suppose. I just always forget long clicks, modifiers and such. I use so many of them anyway, that I find hard to remember those I do not use often, and this is such a case (at leas for me).1 point
-
@Jason Huck Hmmm. So HAProxy is in the mix. Ok, here's a possible scenario that might fit your observations; If HAProxy's server connection times out before Apache finishes, you'll get a 50x error reported (not sure if 502 or 504) in the browser yet the Apache process will probably complete without error behind the dropped connection. Have you looked at the "timeout server" setting (and the other timeout settings) in your HAProxy config file (/etc/haproxy/haproxy.cfg)? I think you'll need to up that beyond where you have the timeout set for the PHP script execution. Edited to add: Have you thought about moving this processing load into a background task?1 point
-
Ok, I made a huge progress after diving into the Inputfield class where I found those hidden features I needed to put the markup just where I needed. PW is great- it seems that Ryan (and others) have thought about all the things someone needs WAY before I added the field name to show on hover - it's animated from the left, with a small delay because it was frustrating moving the mouse around and they appeared here and there. I still need to finish a few things before I publish this but I think the majority of the work is done.1 point
-
Hi, I haven't followed to the end here, but saw something above what I want to mention: using <?php if($page->numChildren) { counts hidden / unpublished / protected pages too, per default. This is implemented in $page to give a quick "overview" of totals, but unrelated to their states. This is useful and was implemented for cases where you have lots (thousands!) of children, to give an raw overview. But in your case, with only a few or NO children, you want to query the exact visible / accessible children for guests. You need to use <?php if($page->numChildren(true)) { see: http://cheatsheet.processwire.com/page/built-in-methods-reference/page-numchildren-bool/ TLDR Before Ryan introduced numChildren(false|true), only $page->children()->count() was available, what needed to read / open all childpages and results into much memory and cpu usage and execution time. With numChildren(false|true) we have a much faster alternative. I think the fasted case is with the param set to false, the default. (Thats why it is the default . But this is only my guessing.)1 point
-
@arjen If you're still waiting for a reply, I would suggest contacting Marvin via Twitter. Last I checked, they were indeed offering this module commercially.1 point
-
Been in that position multiple times and I can highly recommend Ryan for any PW related work.1 point
-
A couple of errors in your function... $output .="<h1><?php echo $page->title; ?></h1>"; The PHP tags shouldn't be here and you cannot echo inside a variable declaration. {$pages->about} ... {$pages->maincopy} These don't make sense - maybe you meant $page ? And totally a matter of preference, but I find... $output = " <div class='container'> <div class='row'> <div class='col-md-12'> <h1>{$page->title}</h1> </div> </div> </div> "; ...more readable than... $output = ""; $output .="<div class=\"container\">"; $output .="<div class=\"row\">"; $output .="<div class=\"col-md-12\">"; $output .="<h1>{$page->title}</h1>"; $output .="</div>"; $output .="</div>"; If you're considering switching to functions instead of includes because of performance concerns I wouldn't bother. It's true that you would avoid some file loads but you'd have to have a lot more includes before this would make a difference worth caring about. One thing to think about when considering a switch from includes to functions is variable scope. Basically, includes have access to variables defined outside of them but functions do not unless you pass the variable to the function as a parameter. This can be a help or a hindrance depending on your needs. Lastly, you could consider using $files->render() (aka wireRenderFile). A file rendered this way has access to all API variables and you can pass in an array of your own variables for use inside the file. I'm not 100% clear on the benefits of this over a normal include but I guess it has to do with the isolation of variable scope (to avoid the risk of overwriting variables of the same name in your template).1 point
-
Hi @kixe, first just want to say thanks for this useful module (if I don't have already)! And I want to share a usage that propably wasn't intended with your module, but I find it useful for small sites where content changes slightly in a weekly manner or less. I use a hook into Session::logout in the ready.php file that invokes a DB-Backup. Currently the simplyfied code looks like: /* Autobackups */ $wire->addHookBefore("Session::logout", function(HookEvent $event) { if(!wire('user')->hasPermission('db-backup')) return; if(wire('modules')->isInstalled('CronjobDatabaseBackup')) { // execute a cronBackup ignore_user_abort(true); set_time_limit(120); $cdb = wire('modules')->get('CronjobDatabaseBackup'); $e = new HookEvent(); $cdb->cronBackup($e); } return; }); This is a bit hacky. What do you think about to embedd a public method to do this more transparent. Also it would be good if the description ($fileinfo) could be set dynamically with this method or as separate method or option. Currently I have hacked this into the module to be able to set it like: "logout horst (CronjobDatabaseBackup)". Anyway, also without that, it is a big, big helper!1 point