Leaderboard
Popular Content
Showing content with the highest reputation on 11/26/2021 in all areas
-
This is a holiday week here in the US, at least for my kids (school break). With kids home I've been off work this week so don't have any ProcessWire updates to report, but I'm looking forward to getting back to work next week and will have more updates to report then. Yesterday was Thanksgiving here in the the US and that kind of marks the beginning of the holiday season here. So today the Christmas tree went up, the lights are coming out and the holiday music has taken over the radio (or Alexa or Google or whatever we call it). Cheers and Happy Holidays!12 points
-
https://www.mamp.info/mamp-friday/ I'm a MAMP Pro + Nano user, I can recommend them. Especially MAMP Pro saves me a lot of time, with features like: 1 click site cloning 1 click site spanhost & restore 1 click SSL config zero configuration Mailhog and more...3 points
-
Maybe money? I mean according to the article, that's the easiest way to do it (apart from spreading the message): https://opencollective.com/phpfoundation I think that currently there is no way to do it together but correct me if I'm wrong. Maybe Ryan could set up a way to pay a small extra for PHP foundation support. What I mean is that there could be an option in the Pro module checkout process for paying an extra $5 for PHP foundation support, so that he could sign up "ProcessWire as a supporter". But the $100/month option would probably be too much, and the OPTIONAL $5 per purchase would never cover it. If there was a $30/month option for small communities like us, that might work out well. Ryan could ask them for such a support option, theoretically...2 points
-
I am a Laragon5 User + HeidiSQL + WinSCP , all 3 in a virtual machine, saves me a lot of time , fast, powerful, stable ... and for free2 points
-
Nikita Popov is about to leave JetBrains, which triggered the birth of the PHP Foundation in order to make sure there will be enough knowledgable and paid developers behind the PHP project: https://blog.jetbrains.com/phpstorm/2021/11/the-php-foundation/ You can even apply for such a position ;) (just bad joke...)1 point
-
I worked with those (VirtualBox, VMWare) that's why I asked. ? Really can't imagine doing so but hey... if this work's for you, I'm perfectly fine with this. Just wanted to make sure I understood that correctly. I'm glad I can keep one machine up and running with my toolset.1 point
-
Ever worked with VirtualBox, VMWare, Proxmox, other ? You build only once a virtualmachine with all your preferred programs, languages, libraries, tools, utilities, components, snippets, etc. etc. You use that virtualmachine as a Template. After that it is simply cloning the Template for each Project. It's like having multiple laptops in a single laptop ?1 point
-
I just published another update. Following a pull request / suggestion from a friend I added support for any text and URL field. Multi-languages support is still there and the field will output as many (non-empty) texts as there are languages. I haven't tested with the textarea field but I assume it will generate the QR code from the raw markup, before any textformatter is applied. I believe this won't be a common use-case, but if need be you can always use hooks to adjust or generate your own QR code. I also fixed an issue where the template-contextual settings weren't applied. Please let me know if you run into any issue.1 point
-
A few suggestions: 1. It's best to match using a page's ID rather than its name, because the ID is globally unique but the name is not. So instead of... $pages->find("template=Technique, relation_technique_substance.relation_technique_substance_select=$page->name") ...you can do... $pages->find("template=Technique, relation_technique_substance.relation_technique_substance_select=$page->id") ...and because the string value of a Page object is its ID it's typical to do... $pages->find("template=Technique, relation_technique_substance.relation_technique_substance_select=$page") 2. You don't need to create a PageArray and add pages to it because $pages->find() already returns a PageArray. So this... $techniques = new PageArray(); $selector_tech = "template=Technique, relation_technique_substance.relation_technique_substance_select=$page->name"; $techniques->add($pages->find($selector_tech)); ...can be simplified to... $techniques = $pages->find("template=Technique, relation_technique_substance.relation_technique_substance_select=$page"); 3. PageArrays have a count() method/property, so rather than... if (sizeof($techniques) > 0) { ...try... if ($techniques->count) { 4. To answer your main question, the value of a Repeater field is a (Repeater)PageArray so you can use ->find($selector) to search within it. foreach ($tech->relation_technique_substance->find("relation_technique_substance_select=$page") as $relation_technique_substance) { Now any Repeater items where relation_technique_substance_select does not include $page will be excluded.1 point
-
Can it be ProcessWire could be listed there? Do we have anything to contribute?1 point
-
I do not have Windows since I am not fond of it either. We'll you can't beat Laragon5, HeidiSQL and WinSCP when it comes to Windows ? I manage every project in it's own virtualmachine, I run every virtualmachine from a simple usb3 2Tb external hdd ... all very practical.1 point
-
Sorry for late reply! Thanks, that worked well!1 point
-
Wow it seems the world is getting smaller and smaller ? I never thought that there are people around here who know this company. But it seems people who like processwire have a good taste overall ? The hosting service is Domainfactory. I work on a freelance base and am hosting multiple sites via a reseller hosting solution that Domainfactory offers. The server performance you get there is a little bit better that the usual hosting package you would chose when running a single site only. I am running a few other processwire sites on other servers and can confirm that everything - even the backend - is really fast on this one. Can't wait to put the next site online.1 point
-
Confirming that the expressions of interest is now closed. I will collate the responses and get back to all who registered. I am working on a getting started frontend that will help with the testing. I am also working on a minimal API documentation to help you put it all together. Thanks to all who have responded and/or have an intention to support this work in the future ?.1 point
-
1 point
-
For a customer I needed a bunch of pictures to make a mosaic in Photoshop (cropped as a square) ? 20 lines of ProcessWire "et voila": a folder full of first pictures of every page from a certain template. <?php namespace ProcessWire; // boot api include('index.php'); // find estates from web database $estates = $pages->find("template=archief-pand"); // if estates count not zero if(count($estates)){ // loop over estates ($e is single estate) foreach($estates as $e){ // if images not null if(count($e->images)){ // get first image of estate gallery $firstPic = $e->images->first(); // resize and crop image to square 800x800px $firstPic = $firstPic->size(800,800); // if picture not null then copy picture to folder propics if(!empty($firstPic)) copy($_SERVER['DOCUMENT_ROOT'].$firstPic->url, $_SERVER['DOCUMENT_ROOT'].'/propics/'.$firstPic); } } }1 point
-
Hello @Ksenia! That’s a browser feature that’s supposed to prevent users from submitting the same form twice. I believe the quickest way to get rid of it would be to add a redirect to the same page after saving: $session->redirect('./', 303); That sends a 303 HTTP status code telling the browser to reload the page using a GET request, which MDN recommends for this purpose, as I understand it. Be aware that ProcessWire exits after a call to $session->redirect(), so no code below that line will get executed. Hope it works for you, I haven’t tested it though!1 point
-
Hi, welcome to the ProcessWire forums! The questions in your recent threads are kind of broad and it’s difficult to tell what exactly you’re struggling with and what you already know. I’m assuming you have ProcessWire installed and working, and you want to save some user inputs from the frontend into the fields you have created in PW’s admin area. Saving fields using the ProcessWire API First of all, you need a page to hold the data. Perhaps this page already exists, then you just get it using selectors, or maybe it’s the page you’re already on. Likely you want to save a new page for every time a user fills out the form, so let’s create a page: $p = new Page(); $p->template = 'form-submission'; //or whatever your template is called $p->parent = wire('pages')->get('/submissions/'); //or whatever the parent page is called Nice. Now, to get the information from the form you’re going to need ProcessWire’s input capabilities. You can find out all about it at the link and you’ll need to make some decisions about validation/sanitization depending on the data you’re dealing with, but the gist is to get stuff from the POST request sent by your user and put it into fields. Let’s say your user submits their e-mail address and you want to save it to a field called email: /* You see the name “email” three times: * 1. The first is the field you set up in the admin area. * 2. The second is the sanitizer that makes sure the thing the * user sent you actually looks like an email address. * 3. The third is the name of the input from from the form the * user filled out and submitted. */ $p->email = $input->post->email('email'); //Now you will probably want to fill out some more fields the same way: $p->comment = $input->post->textarea('comment'); $p->title = 'Form submission from ' . date('Y-m-d H:i'); Then you save the page and you’re done. You can go to the admin backend and check out the newly created page. $p->save(); However, we haven’t talked about the frontend bits yet. Creating a frontend form and sending submissions to ProcessWire Once again much depends on what you actually want to do, but for simplicity’s sake, let’s say this all happens on the same page. You have a ProcessWire template associated with a template file and all the above code is in it. Now we put the form into the same file. Basically the form is sent to the same page it’s coming from, but as you’ve seen above, you can still create the new page wherever you want. So here’s a simple HTML form that submits to the same page: <form method="POST" action="<?php echo $page->url; ?>"> <label for="email">Your e-mail address</label> <input name="email" type="email" /> <label for="comment">Your comment (no swearing!!!)</label> <textarea name="comment" rows="5"></textarea> <input type="submit" value="Send"/> </form> Note how the names of the input fields match the names we accessed earlier using $input->post(). Putting it together If you simply copy all my code blocks into your template file, you’ll probably notice that it tries to create a new page ever time the page is loaded. You’ll need to figure out if there is a form submission at all before you deal with it, and otherwise just skip that part and show the blank form. You may just check if there is anything in the comment variable. So here is your complete template file: <?php namespace ProcessWire; $thanks = ""; if ($input->post('comment')) { $p = new Page(); $p->template = 'form-submission'; //or whatever your template is called $p->parent = wire('pages')->get('/submissions/'); //or whatever the parent page is called $p->email = $input->post->email('email'); $p->comment = $input->post->textarea('comment'); $p->title = 'Form submission from ' . date('Y-m-d H:i'); $p->save(); $thanks = "Thanks a bunch, we value your feedback!"; } ?> <!doctype html> <html> <head> <title>Post a comment</title> </head> <body> <?php if ($thanks !== "") { echo "<h1>{$thanks}</h1>"; } ?> <form method="POST" action="<?php echo $page->url; ?>"> <label for="email">Your e-mail address</label> <input name="email" type="email" /> <label for="comment">Your comment (no swearing!!!)</label> <textarea name="comment" rows="5"></textarea> <input type="submit" value="Send"/> </form> </body> </html> Now I’m not saying you should put this exact code on your website, but it’s a demonstration of the most bare-bones things you’ll need to get input from users: A HTML form that generates a POST request and some PHP code to receive it. It doesn’t matter where these things are or what they’re called or how they’re generated. In this example we’ve written the form by hand because it’s easy, but you could just as well generate it from ProcessWire’s fields.1 point
-
I've just recoded a brief video where I've tried to explain how to install tailwind inside Processwire ( really badly spoken ? , so be kind...) Moreover I've updated the gist here to reflect the changes I've made since the last time I've written the guide above. There you have it:1 point
-
@MilenKo thanks for the wonderful thread, but I would like to know how to add a new custom field to the input form ? I need to add the phone number instead of the website when a comment is created. How to make this work ? thank you1 point
-
1 point