-
Posts
6,629 -
Joined
-
Last visited
-
Days Won
358
Everything posted by bernhard
-
Best Practice for Dropdown Trigger Links and Page Structure
bernhard replied to anyway's topic in General Support
Hi anyway, I think I read your post in the other thread but didn't get your point. The problem you are describing here is not processwire specific - it's a general problem related to touch and non touch devices. you can find some possibilities here (and in the linked thread): -
hi thuijzer, would you mind adding a screenshot to get an instant first impression of how it looks like?
-
great idea, thx! needed that several times and maxLength=>... was a pain would it be hard to have the shortcut bdb() for bd($page, [6,999]) ? i think it would totally be fine to have that shortcut with fixed values since we have the other option of defining it manually like you showed above. but i think in 99% of the cases the bdb() would work just well and it is less to write and a lot easier to remember
-
looks interesting! so @kongondo don't you use vscode git at all or do you use vscode git for simple tasks (like shown in my screenshot) and sourcetreeapp for more complex ones? thx
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
wow! thank you for all your work! loving the logo - just updated my signature
-
Making future website upgrades more error prone and time consuming, I agree. I don't have this feeling. One of the things I like most about PW is that I don't really have to care about updates. But I agree that it would be better to have less new features pushed out every week and have a little more conversation upfront to make the result as good as possible. Yes, we should get more organized somehow. yep, my vote for better community managment here I'd be happy to help in this regard as much as I can.
-
thx @Peter Knight don't know what the benefit of another program should be... I like to have everything in the editor and see everything live while I'm working on the code: only thing missing is a proper way to push changes to a pw site... but that's part of the roadmap thread (of course it is possible, but as mentioned there I think it is a lot more complicated to achieve than I am used to by processwire easiness).
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
[offtopic, sorry, please comment here in case of questions/interest] Agree it should not be a dependency, but regarding git I can really recommend gitlab.com + vscode - no cli at all, all free and really nice and easy UI:
-
@noelboss just posted a comment in this thread and the thread is just one of many examples of people looking for solutions of a proper staging/production strategy. we have some modules that try to close this gap, but imho this is an important part of a professional workflow and therefore should be part of the core. don't know how that could be implemented exactly, but at least it would be great to have a thought-out strategy and maybe some kind of standard/best practise guide of how to keep staging/production in sync, be safe while editing, integrate GIT in this process etc. while other features are nice to have for me, this is really one thing that makes me feel totally unprofessional and is a huge pain. i don't think that the options we have so far are as good as they could be. for example if i had to push a fix to a live system, i wished it would be possible to: pull the latest version from live to dev with one click (excluding a predefined list of files / db tables) work on that dev version locally (having all files on the local computer makes searching all files a lot easier) push the fix to git push the fix to production some parts of this workflow can be done with the migrations module, some with the quite new duplicator module, some could be implemented via githooks, but, hey... we are talking about ProcessWire and where PW really shines is making our lives as devs easier and in this special case i feel that this is not true maybe i'm just too inexperienced in this topic and there are proper solutions out there, but following the forum over the last years i didn't see a solution that felt "processwire-awesome". maybe a blog-post covering this topic could be a first step. and maybe i'm totally alone with this opinion... a feature request-voting system could also help a lot here [pub] that was the tracy-boost
-
totally agree! right now it sometimes seems that the interest is measured by "who shouts loudest"... but we had several examples where users didn't show their interest because the feature has been on the roadmap for a while so nobody said anything about it and waited for a surprise in the next blogpost. just if it was requested this is great example of what robin is talking about. informations about upcoming features are spread over the forum (wishlist) and github... so i want to support robins request and maybe extend it a little bit towards "better community management". we had one occasion where @ryan implemented something that was already available as a module (image tagging). don't get me wrong, of course i prefer solid solutions built into the core over 3rd party modules (i was voting for the predefined-crop-in-the-core-feature for a long time), but i would love to see a little more discussion and community involvment here. i can imagine that this can eat up a lot of time if done wrong - but i think it can also save time if done right. for example the community could do some research (like in the github link above), bring in ideas or point ryan to already existing solutions like it was the case with image tagging. finally i want to thank everybody contributing to this project and helping me out in the forum. i had a great 2017 and it would not have been possible without this awesome product and community! happy and successful 2018 to everybody
-
@SamC don't know if you just put a quick example here but in your case the checker class does not do anything more then the valitron class so it is nice for testing but actually quite useless do i miss anything? btw: I don't know valitron, I only used https://doc.nette.org/en/2.4/forms#toc-standalone-forms since this is the only library I know that does client-side and server-side validaton in one go. maybe you want to have a look...
-
one way (maybe the best?) is to extend the class: https://stackoverflow.com/a/8089092/6370411 another way is to store the other class as property of your new class: <?php class Checker { private $validator; public function __construct($validator) { $this->validator = $validator; } public function doSomethingWithValidator($name) { return $this->validator->errors($name); } } require_once('Yourvalidator.php'); $validator = new Yourvalidator(); $checker = new Checker($validator); $checker->doSomethingWithValidator($input->post->name);
-
that's why you should start playing around with classes <?php class Formchecker { public $errors = []; public function checkemail($email) { if(!$email) { // or any other great check $this->errors[] = 'Please provide an email'; return false; } return true; } public function checkname($name) { if(!$name) { // or any other great check $this->errors[] = 'Please provide a name'; return false; } return true; } } $checker = new Formchecker(); $mail = $checker->checkemail($input->post->email); $name = $checker->checkname($input->post->name); // if($mail AND $name) { if(!count($checker->errors)) { // create new page and send email } else { echo 'Please correct the following...<br>'; foreach($checker->errors as $error) echo "$error<br>"; }
-
sorry, took the wrong code snippet, but totally agree on that
-
maybe something like this? // early exits if(!$input->post('register')) return; if(!$session->CSRF->hasValidToken()) { header("Status: 401", true, 401); return; } // define variables $errors = []; $regEmail = $input->post->email( 'regEmail' ); // check for errors if(!$input->post->text('g-recaptcha-response')) $errors[] = "Invalid Captcha response."; if( $users->get( "email=$regEmail" )->id ) $errors[] = "You cannot register more than one account with the same email address."; // return error-array or true if(count($errors)) return $errors return true; nice read @FrancisChung reminds me a little bit of this section in my new kickstart installer: https://gitlab.com/baumrock/kickstart/blob/master/kickstart.php#L139-146 Maybe I'm just too lazy for learning new things but I don't really think that the pipeline is that much better than using ifs and separate methods in a regular class...
-
Thanks kongondo and robin, I also thought the hook was wrong and learned something from the docs @adrian maybe for the hook recorder it would be possible to see somehow if the hook is one that actually does anything (so before and after do matter) or that does nothing (like saveReady. Just thinking loud - no idea how complicated that would be. Don't think it would really be important - but if it was easy it could be a nice addition. @joe_g don't know what could be the problem (dates are always confusing), but maybe the execution of the hook fails sometimes because you get a php error (like cannot call property of undefined etc...). maybe you can install tracy and make sure you define your email adress then tracy will send you all errors that occur on your site. maybe you can also find some helpful information in your site's error logs.
-
Hm... thanks for that hint. I'm not sure if I like the idea of adding a password. It would break the functionality - at least I would have to put in more work. I didn't think of password protecting it, because that's the same with the regular installer (it is also visible to the public as long as the installation did not finish). The only difference at PW Kickstart is that it enables you uploading files, that's true... But still i don't think that it is necessary to password protect the directory. The goal of this installer to make the process of creating new pw websites as easy and as fast as possible and to eliminate all of the repetitive tasks that one has to do on every new pw installation. Ok I just got an idea: The downloader at baumrock.com/kickstart.php actually grabs the file from the gitlab repo and replaces the namespace ProcessWire on the first line with namespace Kickstart. This is do make sure the installer works both as an installer and as a helper for the Recipe Processmodule. I could easily add some lines of code to that service that adds the IP of the requesting client to the kickstart.php file and blocks all requests that do not come from that IP. What do you guys think?
-
Finally
-
nope, this was a pr for another thing and is already merged
-
Seems that this pub is a little boring But I can live with the <ironic> tags
-
DEPRECATED - USE ROCKMIGRATIONS INSTEAD I'm very happy to share my newest module called "ProcessWire Kickstart" that I developed during the holidays Maybe some of you already saw the preview thread about this... What it does: This module makes it possible to install ProcessWire in a fully automated process. You can define all necessary settings in one single php file and you can even define "recipes" that get executed after installation. This means you can install modules, adopt settings and do whatever you want with your new site using the PW API (like creating pages and so on). You could also place a kind of frontend boilerplate on your git account and grab that after installation and place it in your templates folder. I ran out of time so maybe someone could try that out and show how he did it Additional to that there is a ProcessModule to install in your ProcessWire admin which makes creating and testing recipes super easy. Note: Alpha realese until this module gets some more testing. Please be careful with this tool since it does some heavy file system manipulations (unzipping, moving and DELETING whole directories...). Use at your own risk. Usage: Just grab a copy of the kickstarter, place it on your server, visit yournewsite.com/kickstart.php, adjust settings (like username+password) as needed and hit "install". If your mysql user does not have the rights to create a new database then you have to create a database before running the installer! Download: via SSH: cd /var/www/yournewsitedirectory wget baumrock.com/kickstart.php // or using curl curl baumrock.com/kickstart.php -L --output kickstart.php Manually: Klick baumrock.com/kickstart.php and upload the file to your server Note: baumrock.com/kickstart.php returns the current master file from the gitlab repo and changes the namespace of the script so that it can install itself via recipe. If you don't need to install the kickstart processmodule via recipe you could also download the kickstart.php file from gitlab. Screenshots/Walkthrough: The initial Screen: You can either upload a file via the left panel or take my example file from the gitlab repo: This way you can create your own kickstartfiles and host it on your own accounts. When the file is loaded you can easily edit all necessary informations, like username, password and the url where to grab ProcessWire from. I just tried it with an old version as well... 2.7 worked just fine (having the old installer that recently was updated) but an ancient 2.2.4 version failed. I don't think anybody will ever need to install lots of old versions of pw with this tool but I wanted to mention it here. Hit "install" and lean back - on my VPS it takes 15 seconds to install my very own custom version of processwire with all modules that i need After logging into your admin you'll see that all modules from your recipe are installed: Recipe Editor: As recipes are executed after processwire was installed you have all your API magic available there. Running this scripts is only possible inside of a working processwire installation, so I created a module to help you with that task. See the comments of the sample recipe for more information! I hope this tool helps you to save lots of time and create lots of awesome ProcessWire websites I would be happy to see how you use this and please share useful recipes here in the thread so that everybody can profit. Maybe you just want to throw in an idea what could be done (for example I can imagine a recipe that checks file permissions on the system after installation)... Some parts of the code and maybe also part of the idea are taken from @Soma 's old and still great online installer, thx for that!
- 25 replies
-
- 24
-
-
If you haven't heard about it yet you should read about these new vulnerabilities that affect almost any computer built since 1995 https://en.wikipedia.org/wiki/Meltdown_(security_vulnerability) https://en.wikipedia.org/wiki/Spectre_(security_vulnerability) https://insights.ubuntu.com/2018/01/04/ubuntu-updates-for-the-meltdown-spectre-vulnerabilities/
-
looks great
-
Module idea: index + search file-contents
bernhard replied to dragan's topic in Module/Plugin Development
Nice idea! I have no need for it, but if i had, it would be great to have such a feature! And I can think of lots of usecases where someone could need this... [offtopic] I'm out- 7 replies
-
- 1
-
-
- file-search
- uploads
-
(and 2 more)
Tagged with:
-
thanks @SamC that brings some light into the dark of customizing the admin, at least for me can you please elaborate how you created this theme's less file? did you just copy&paste&modify it from the original theme? I haven't had a look into the theme's less yet, but regarding the template designer module i have some nice news: I'm just working on the PW Kickstart module and creating a processmodule which makes it very easy to modify the code of the recipes and run it. That's a perfect fit for modifying LESS files of your theme, compile them on save and instantly show the new theme. I'll try to put something together in the next few days with the help of your tutorial