-
Posts
1,510 -
Joined
-
Last visited
-
Days Won
16
Everything posted by Ivan Gretsky
-
Wouldn't it also break complex fields frontend editing, which happens in popup iframes with admin pages loaded?
-
Hello! I need to show pages with date range publish limitation. I mean each page has date_start and date_end fields, that, if populated, should determine, whether the page is considered "published" today. But none of those fields is mandatory. You can fill one or the other or both. I have written a selector with OR-groups like this: $selector = "SOME-CONDITION-HERE, "; $selector .= "range=(date_start='', date_end=''), "; $selector .= "range=(date_start='', date_end>=today), "; $selector .= "range=(date_start<=today, date_end>=today), "; $selector .= "range=(date_start<=today, date_end='')"; But is seems a little ugly and over-complicated. I thought maybe someone could propose a better solution? If not, let it be a working example of how to deal with this)
-
solved Search in multilanguage site with multilang fields
Ivan Gretsky replied to seddass's topic in Multi-Language Support
Maybe it is worth rethinking this implementation? When checking is a field is empty or not, for example, fallback to default is a bug. The hack solution is kinda ugly and unintuitive. And one of PW's strongest points is multi-language support. What do you think, @ryan? P.S. I just tried it out one more time. It seems that if you check if the field is empty using just the field name, it checks only the default language. So if the field has text in user lang but not in default, the check is falsely false. So might be a real bug here.- 15 replies
-
Lots of useless stuff on Wordpress, coronavirus, and motivating yourself to effectively deal with those, but not enough on ProcessWire))
- 5 replies
-
- 2
-
-
-
- autoload
- namespaces
-
(and 2 more)
Tagged with:
-
Most of us know and use site/config-dev.php file. If present, it is used instead of site/config.php, so it is easy to set database connection and debug mode for local development, not touching the production config. It is also very useful when working with git. You can simply ignore it in the .gitignore file, so local settings won’t end up in the repo. But sometimes you need to add code to site/ready.php or site/init.php just for the dev environment. For example, to add ryan’s super cool on demand images mirrorer. I can’t live without it when working with big sites, which have more assets then I want to download to my desktop. It would be great if there was something like site/ready-dev.php for this. Not out-of-the-box, but it’s pretty easy to achieve. Unlike site/config-dev.php, site/ready.php is not hardcoded. It’s name is set with a special config setting: // wire/config.php $config->statusFiles = array( 'boot' => '', 'initBefore' => '', 'init' => 'init.php', 'readyBefore' => '', 'ready' => 'ready.php', 'readySite' => '', 'readyAdmin' => '', 'render' => '', 'download' => '', 'finished' => 'finished.php', 'failed' => '', ); As you can see, we can not only define, which files are loaded on init, ready and finished runtime states, but probably even add more if we need to. So we override this setting in site/config-dev.php like this: // site/config-dev.php // Change ready.php to ready-dev.php $temp = $config->statusFiles; $temp['ready'] = 'ready-dev.php'; $config->statusFiles = $temp; For some reason we can’t just do $config->statusFiles['ready'] = 'ready-dev.php'; and have to override the whole array. Maybe you PHP gurus can explain this in the comments. Now we can create the site/ready-dev.php file and place all the dev-only code there. Important thing is to include the main site/ready.php. // site/ready-dev.php include 'ready.php'; // DEV HOOK TO MIRROR ASSETS ON DEMAND $wire->addHookAfter('Pagefile::url, Pagefile::filename', function($event) { $config = $event->wire('config'); $file = $event->return; if($event->method == 'url') { // convert url to disk path $file = $config->paths->root . substr($file, strlen($config->urls->root)); } if(!file_exists($file)) { // download file from source if it doesn't exist here $src = 'https://mysite.com/site/assets/files/'; $url = str_replace($config->paths->files, $src, $file); $http = new WireHttp(); try { $http->download($url, $file); } catch (\Exception $e) { bd($file, "Missing file"); } } }); Do not forget to replace "mysite.com" if you’re copypasting this)) Now, add the newly created file to the `.gitignore` and we’re done. # .gitignore # Ignore dev files site/config-dev.php site/ready-dev.php Thanks for reading!
-
Great read! Perfectly laid out! A ready Medium article in a post! And maybe it should be published elsewhere, as it provides a lot of useful info not only for PW devs (and would bring some attention to PW).
- 5 replies
-
- 3
-
-
- autoload
- namespaces
-
(and 2 more)
Tagged with:
-
Hey, @Hurme! Could you post a screenshot with comments? What exactly do you wanna change? Anyway, contents of those modals must be iframes with admin pages with admin theme in them. So the reasonable way to customize the modal contents must be to change the admin theme.
-
You need to handle 404 errors yourself. Look here for a working example.
-
Good day! This module looks super useful but also quite dated. Does it work with modern PW? Could anyone share their experience with it?
-
Good day everybody! Thanks for the module @ryan! Is there an easy way to integrate social login into this?
-
Could you please share a bit more. A simple gist would be perfect))
-
Good day, @Martijn Geerts! This module does not state PW3 support. Do you see any potential problems? If not, maybe update the description?
-
RockNette - Wrapper to integrate Nette Framework into ProcessWire
Ivan Gretsky replied to bernhard's topic in Modules/Plugins
The links seem to be broken @bernhard. By the way, could you share your experience using nette forms. I did try to incorporate them, but never actually finished(( -
Great work @teppo! Could explain a bit this feature "- Support for rendering pages that have not been "routed" to Wireframe using the altFilename template setting." Or just point the docs - did not fins corresponding article there.
-
Z-index does not solve the problem. Chat window is added with js and is always on top.
-
Good day @adrian! I want to move Tracy bar from right bottom corner to the left. So the online chat box would not be in front of it. I saw the bar being moved here and there, but I can't reproduce it in my installation. How do I do it?
-
Hey @Wanze! Thanks for this great module. Seems like it is compatible with PW3, but module info is saying it's not. If you got dome time please update compatibility info.
-
Where do I store arbitrary data like global info or settings?
Ivan Gretsky replied to Vigilante's topic in Getting Started
Just to give you another option. Check out this module by @ryan himself. I did not find it in the modules directory. And it did not receive much attention from the author in a while. But it did the job when I used it (a few years ago ?) . As far as I remember it stores custom data written in site/config.php. And it is manageable from admin without the need to create pages. -
Your keyboard on ProcessWire... any questions?
Ivan Gretsky replied to Jonathan Lahijani's topic in Pub
Oh gosh! It's so relieving to know mine is still in pretty good shape comparing to you guys. It is still new and shining (when looking from some angles). The only thing with it really is that my then 2-year old managed to take off the up arrow key. I do not know how can a little kid make something totally disappear in just a few seconds. He did not eat it (at least nothing came out). I searched everywhere, found quite a lot of useful stuff, but not the key. So I moved F10 as a substitute as it is obviously much less critical one. A few little tips for someone in the very same situation: Use Esc+0 to quit Midnight commander. Use a pencil to save bios configs. Never worry 'bout anything else! -
Hey, @Macaco! This very question has been asked a trillion of times on the forums. And here is the way to find the answers already given: go here and search. The forum search does not work well. The closest to what you desire is probably the Duplicator module, but I never used it in production. I suggest you make yourself comfortable with moving you site here and there "with bare hands" anyway. It is not that hard. You just need to: Copy files. Backup database and restore it where you want the site to be moved to (probably some local dev env like xampp or laragon). Adjust site/config.php (or better use config-dev.php - look here at the very botoom). There is a lot to it only the 1st time)
- 1 reply
-
- 4
-
-
-
Minisocial Login/User Registration System
Ivan Gretsky replied to franciccio-ITALIANO's topic in Getting Started
ProcessWire is mature enough. But is not a ready-made solution for this niche, like the names you mentioned. I have made a system quite similar to what you've described here. But it was a lot of work. And it was made with PW to support dealing with objects already in PW. So I would support @wbmnfktr here. If you got time budget and the skills (or want to aquire them), and you know you will use ProcessWire for some things not available out of the box in the ready-made solutions, than go for it using PW. If not and you just need a quick turnover, use one of a plethora of ready made stuff. Just test it out out before making a final decision.- 3 replies
-
- 2
-
-
- notificazion
- social core
-
(and 2 more)
Tagged with:
-
I use WSL all the time, but my local server is still on Windows. It used to be XAMPP, but now I move to Laragon. One of the beauties of Laragon is that you can easilly swith PHP, Apache, MySQL and everything else versions almost instantly. As far as I know from my attempts to set everything up on Linuх, it is not that that easy there (though, surely, possible). I have not found any configuration for Linux that would be nearly that easy. Docker based Laradock was the closest, but it still required some additional docker skills, was not as fast and more complicated. And docker sucks badly on WSL)))
-
Hey, @alanxptm! I am just guessing, but maybe you got your description filled only in one language, but output the value of some other (probably default) language. And it is blank.
-
Probably nothing to do with the ProcessWire core. Maybe you are setting/configuring sesssions in your own code not with the API, but with plain PHP and that causes the warnings?