Leaderboard
Popular Content
Showing content with the highest reputation on 05/10/2017 in all areas
-
Working on it as we speak. Other stuff got into the way and had to shelve it for a while. Like I said though, the module is ready, just working on the documentation and some final checks. I am hoping for a release next week.4 points
-
I can't believe I wrote that post almost 2 yrs ago and can't remember where I've used that snippet so I guess I'm getting old2 points
-
Ha yeah! I had a ZX spectrum +2 with the tape loader which was awesome, used BBC in school, then got my Amiga 500. Never had megadrive/snes or anything like that. Windows after that, win95 all the way to win10 mixed with a few Mac Minis and Macbooks. Amiga is the one that brings back the best memories though. I'd go full time linux if they could meet my very undemanding requirements: 1) XAMPP 2) ST3 3) Filezilla 4) Gimp 5) Inkscape ...all good so far, then it starts to fall apart 6) Skype (bit ropey) 7) Spotify (broken and not updated) 8) Steam (good if you can get proprietary drivers working without tearing) - ultimately, it sucks and works much better on Windows 9) Studio One 3 with my RME babyface for recording guitars (absolute fail, and Wine makes me want to gouge my eyes out) 10) Office 2016, yeah there's libreoffice but it just doesn't cut it, I tried for a year. That said, I'd give it another go. 11) Stop me having to do this for sanities sake! https://patrickmn.com/aside/lowering-gaming-mouse-sensitivity-in-ubuntu-9-10/ I have a gaming mouse, so it's xinput time. See when this article was originally written?! I do actually really like Linux but number (9) is an absolute dealbreaker (and the other items on the second list are a compromise with no really decent solution, unless you store all your music locally, like I did in the 90s...) so I always have to have a WIndows partition i.e. keeping two OSs updated. For me, it's like this: OSX is super expensive and no tinkering allowed (hackintosh nearly had me bald after a couple of weeks, and that was just getting it to work), Windows doesn't have the awesome unix style base (love me some terminal), Linux doesn't run everything I use. Should just give up and become a farmer, far far away from computers @DaveP I'll check them out thanks. @GuruMeditation manjaro looks promising. See what's happening? Already distracted lol.2 points
-
Even though I'm using a mac almost exclusively at the moment, a couple of Linux distros worth checking out are ChaletOS and Zorin OS. Both are highly usable Windows replacements, as is Manjaro, as suggested by @GuruMeditation. We installed them at the last place I worked for (a mix of Manjaro, Chalet, Zorin and Mint due to some antediluvian hardware), in the telesales department after one of them managed to get CryptoLocker on her PC. Don't think they even noticed. Also, while I'm chiming in with software recommendations, LibreOffice is a very capable MS Office replacement (and much better than OpenOffice).2 points
-
I know this is a pretty old thread, but every time it comes to creating a Repeater through the API, I get LOST. @thetuningspoon's function illuminates a LOT of what happens behind the scenes when a new Repeater is made through the GUI - but I just keep wishing it was as simple as: $f = new FieldtypeRepeater(); $f->set('name', 'repeaterTest'); $f->add($repeaterField1); $f->add($repeaterField2); $f->save(); Because that isn't technically possible without setting the Fieldgroup or Template that will be used by the Repeater first, right? At the end of the day, I think we should improve the docs for Repeaters (https://processwire.com/api/fieldtypes/repeaters/) to include a section on creating a Repeater from scratch through the API so that this process is more easily understood. I am always referencing several Forum posts and parts of the docs in order to get through the spaghetti - having everything in one place would be great. Otherwise it would be awesome to have some functions as a part of the FieldtypeRepeater Class that cut down on the amount of API calls one needs to make in order to create one of these. Just my 2 cents.2 points
-
At the moment, I'm on Win10, using ST3 and scoop for pretty much everything dev-related. Looking to switch to the next iteration of Ubuntu, which I hear is dropping Unity in favour of Gnome. I can imagine it'll be quite the change, especially with tools exclusive to Windows, such as Adobe CC. (so I'd have to use wine or a VM for that). Guess I'll miss WIndows incredibly as I'm so used to it, but change is as good as a holiday, as they say, and I'm in serious need of a holiday (or ten, consecutively). As for why I'm going to land up going this route: Windows is starting this whole SaaS paradigm, which I'm seriously not into at all. If I did land up getting into it, I'd probably only do it for the unix part of Windows. That said, better to develop on Linux as most servers are linux-based and, with Windows, you can ignore a whole host of things that don't make any difference (you know, like permissions, paths, etc). Side note: Office 2016 feels like a joke to me. Much buggier than 2013. However, I really like Exchange, but I'm sure there are good Linux clients that could handle Exchange pretty well (there's also OWA, which is actually pretty good for my needs).2 points
-
For more advanced uses (api or even json-api by specification) I'd recommend something like fractal.2 points
-
I was raised on the C64 and then the Amiga. Those were great times for me. Sadly, my Amiga died in the 90s, so I reluctantly moved over to the PC. I used the Mac in college, but that was purely for Photoshop, and nothing ever had the same impact as my trusty Amiga. After years of using Windows, I decided that Windows 7 was the last version I'd use. It's a good OS, but I only really used it for Photoshop etc. So since then I have been using Manjaro Linux. I won't touch anything else other than an Arch-based OS anymore, and Manjaro adds a nice user-friendly option for it. I've tried all flavours of Linux, but I've always had problems at some point over silly little things. Manjaro? never had a single problem. https://manjaro.org/ Note: I use the main XFCE edition as it's lightweight and stable.2 points
-
For simple json outputs, you can use WireArray::explode and json_encode() or wireEncodeJSON() methods https://processwire.com/api/ref/wire-array/explode/ $myPages = $pages->find('template=basic-page'); // extract required fields into plain array $data = $myPages->explode(['title', 'created']); echo wireEncodeJSON($data);2 points
-
Just a repeat of part of a message above so hopefully more of you will see it: I am going to be mostly offline for the next 2 months, starting right now It's going to be strange being away from PW and the forums for so long. Hopefully if anyone has any issues with this (or any of my other modules), some of you who are more experienced might be able to help, or at least let those users know that I am away and will take care of things when I return. Cheers all!2 points
-
FacebookEvents ProcessWire module to get Facebook Page Events using the Graph API. Create an app on Facebook developers website You have to create an app to get appId and appSecret. Those keys are required. Go to Facebook Developers and add a new app. Congrats! Now you can copy your Facebook appId and appSecret. Get your Facebook page ID You can either enter your facebook page ID or the facebook page name. If you enter the Facebook page name, this module will get the page ID for you! Call Module $events = $modules->get('FacebookEvents')->getEvents(); Output Events {% for event in events|reverse %} {% if event.start_time|date('U') > date().timestamp %} <div> {% set dts = modules.get('FacebookEvents').getDates(event) %} <a href="https://www.facebook.com/events/{{event.id}}/" title="Facebook">{{dts.dates}}:</a> {{event.name}} <em>{{dts.times}}</em> </div> {% endif %} {% endfor %1 point
-
Try this (not tested): $recent_items = 3; $items_per_page = 10; $most_recent_news = $pages->find("template=news, parent=1027, limit=' . $recent_items . ', sort=-publish_from"); //3 most recent news foreach($most_recent_news as $post) { ///markup } $news = $pages->find("template=news, parent=1027, 'id!=' . $most_recent_news . ', limit=' . $items_per_page . ', sort=-publish_from"); //List of next 10 foreach($news as $post) { ///markup } echo $news->renderPager(); //render pagination1 point
-
Try removing the IDs of the 3 first items from the query, like on this example by @tpr:1 point
-
Maybe this is related to the things described here: https://processwire.com/blog/posts/merry-christmas-heres-processwire-3.0.3-and-2.7.3-and-some-more/#improvements-to-the-operator-in-page-finding-operations1 point
-
At the moment the endpoint just returns: id, name, timezone, start_time, end_time, description. But it's pretty easy to get the information about the place and cover. I updated the module to include it as well and updated the Graph Api Version to 2.9. `$modules->get('FacebookEvents')->getEvents()` returns now the following data: array(1) { [0]=> array(6) { ["id"]=> string(15) "123123123" ["name"]=> string(3) "xxx" ["timezone"]=> string(13) "Europe/Berlin" ["start_time"]=> string(24) "2017-06-23T16:00:00+0200" ["end_time"]=> string(24) "2017-06-23T18:30:00+0200" ["description"]=> string(3) "foo", ["place"]=> array(3) { ["name"]=> string(5) "Venue" ["location"]=> array(6) { ["city"]=> string(7) "Berlin" ["country"]=> string(7) "Germany" ["latitude"]=> float(xx.3321915) ["longitude"]=> float(xx.3735704) ["street"]=> string(17) "Street 14" ["zip"]=> string(5) "01234" } ["id"]=> string(15) "123123123" } ["cover"]=> array(4) { ["offset_x"]=> int(0) ["offset_y"]=> int(85) ["source"]=> string(148) "https://scontent.xx.fbcdn.net/v/t31.0-8/s720x720/..." ["id"]=> string(16) "123123123" } } } Having a quick look at the Graph API documentation, using the event ID one could send another request to get even more data. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api/reference/event/.1 point
-
1 point
-
The first two arguments to the size() method are expected to be integers, so your $options array is being cast to an integer. Maybe you intended: src='{$port_item->images->first()->width(414,$options)->url}'1 point
-
1 point
-
This was bothering me when I was working on this question about PageTables. It appears that Tracy isn't included when page is called via a modal. Check this out // /site/modules/TracyDebugger/TracyDebugger.module public function init() { // ... // EARLY EXITS // modals if(in_array('regularModal', $this->data['hideDebugBarModals']) && $this->wire('input')->get->modal == '1') return; if(in_array('inlineModal', $this->data['hideDebugBarModals']) && $this->wire('input')->get->modal == 'inline') return; // ... } We need you @adrian, come back!1 point
-
I'm proud to present you: "The Crafters" Premium cocktails from Belgium! Enjoy! https://www.crafters.be/ (Front-end build with https://semantic-ui.com/)1 point
-
1 point
-
Ok, I'm not so good at shutting down and 'turning off' when there's a problem to be solved. So my emails are sending now, I get the success message, but no emails! So I even went as far as messing about in php.ini to enable the sendmail, it's off by default in MAMP (free) but switchable via the UI in MAMP (paid). So I did this: http://www.blog.tripleroi.com/2012/05/solvedenabling-sendmail-on-localhost.html Tried again, no luck. Then noticed I had 16 emails in my SPAM folder! Lesson learned. Here's my rendition of contact.php, just a single file, using the MarkupGoogleRecaptcha module, works locally (validates form/validates recaptcha, and sends email correctly): // contact.php <?php namespace ProcessWire; wireIncludeFile("./vendor/vlucas/valitron/src/Valitron/Validator.php"); $captcha = $modules->get("MarkupGoogleRecaptcha"); $contactPageID = '1022'; $contactFormRecipient = 'my_email'; $name = $sanitizer->text($input->post->name); $email = $sanitizer->email($input->post->email); $message = $sanitizer->text($input->post->message); $v = new \Valitron\Validator(array( 'name' => $name, 'email' => $email, 'message' => $message ) ); $v->rule('required', ['name', 'email', 'message']); $v->rule('email', 'email'); if ($input->post->sendMe) { if ($v->validate()) { if ($captcha->verifyResponse() === true) { $message = " <html> <body> <p><b>From:</b></p> <p>{$name}</p> <p><b>Email:</b></p> <p>{$email}</p> <p><b>Message:</b></p> <p>{$message}</p> </body> </html> "; $mail = wireMail(); $mail->to($contactFormRecipient) ->from($email) ->subject('Contact form submission') ->bodyHTML($message) ->send(); if ($mail->send()) { $session->flashMessage = "<h2>Thank you for your message! I will get back to you shortly.</h2>"; $session->sent = true; $session->redirect($pages->get($contactPageID)->url); } else { $session->flashMessage = "<h2>Mail not sent. Error occured.</h2>"; } } else { $session->flashMessage = '<h2>Recaptcha must be complete.</h2>'; } } else { $session->flashMessage = '<h2>Please fill out the fields correctly.</h2>'; } } ?> <div class="body-row"> <div class="wrapper"> <?php if($session->flashMessage):?> <div class="alert <?php echo $session->sent ? 'alert-success' : 'alert-danger'?>" role="alert"> <?php echo $session->flashMessage;?> </div> <?php endif;?> <form id="contact-form" method="post"> <div class="<?php echo $v->errors('name') ? 'has-error' : ''?>"> <label for="name">Name (required)</label> <input class="form-control" name="name" id="name" type="text" value="<?php echo $sanitizer->text($input->post->name)?>"> </div> <div class="<?php echo $v->errors('email') ? 'has-error' : ''?>"> <label for="email">Email (required)</label> <input class="form-control" name="email" id="email" type="text" value="<?php echo $sanitizer->text($input->post->email)?>"> </div> <div class="<?php echo $v->errors('message') ? 'has-error' : ''?>"> <label for="message">Message (required)</label> <textarea class="form-control" name="message" id="message"><?php echo $sanitizer->text($input->post->message)?></textarea> </div> <div> <!-- Google Recaptcha code START --> <?php echo $captcha->render()?> <!-- Google Recaptcha code END --> </div> <div class="centered"> <button type="submit" name="sendMe" value="1">SEND MESSAGE</button> </div> </form> </div> </div> <?php $session->remove('flashMessage'); $session->sent = false; echo $captcha->getScript(); ?> Big thanks to @giannisok for the original ideas @danielsl maybe you could try this to see if you have more luck? It's been a great learning experience so far, so thanks all.1 point
-
1 point
-
I got the same problem, having a slider (carousel) with the first N pages, then the rest are listed below that (and paginated). Using "start" screwed things up. However, getting pages to exclude first and then building up the pages to paginate worked: $carouselItems = 2; $itemsPerPage = 5; // get page IDs to exclude $carouselItemIDs = wire('pages')->find('limit=' . $carouselItems . ', sort=-publish_date')->id('|'); // get pages for pagination (without carousel pages) $myPages = wire('pages')->find('id!=' . $carouselItemIDs . ', template=recipe, limit=' . $itemsPerPage . ', sort=-publish_date');1 point
-
Hello, all! Sorry if this should be in another forum, but I didn't see one for general introductions, testimonials, and the like. I actually don't need help yet (the documentation and existing forum threads have already been immensely helpful), but I am just finishing up my first project using ProcessWire and felt the need to come here and say thanks. I've been designing/developing websites for several years now, and this is by far the most intuitive CMS I've used...from both a development and end-user standpoint. I just showed my most recent client the backend a couple of days ago and he was amazed at how easy it was for him to update content. So, thank you!1 point
-
That syntax is valid–I think when I replied before that the morning coffee hadn't quite kicked in yet. But, if you need to access the first element, I think it's better to use first() rather than get(0) just because there's always a possibility that the item at index 0 was removed somewhere else, or that the PageArray was at some point sorted so that index 0 was no longer the first item. If you don't have any other manipulations going on with your PageArray, then accessing get(0) is probably just fine though.1 point