Leaderboard
Popular Content
Showing content with the highest reputation on 06/03/2016 in all areas
-
Working through GitHub issue reports was the focus of this week, and it looks like we've got one more week to go in working through the current queue. There have not been any major bugs in 3.x, so things are looking more and more stable. Most updates in this weeks version (3.0.20) are about fixing minor bugs and various cosmetic things. There's nothing particularly exciting to report in this version other than that. But working towards a fully stable 3.x master version is itself an exciting thing. So rather than focus on the small tweaks and fixes from this week, lets backtrack and review all that's new in 3.x relative to the current 2.7 master version… https://processwire.com/blog/posts/review-of-processwire-3.x-so-far/8 points
-
This is the website that we launched this one some weeks ago for an Art Therapist based in Zurich. http://heikeprehler.ch/ We had to deal with a quite large amount of text here, so our main concern was to make the website light and easy to navigate (also vertically, inside each page). On the backend, we also decided to divide everything very well, to make it easy for the client o edit, but also to make it easy for us to output the content as flexibly as possible. Each content page is divided in blocks of children, that allowed us to have IDs for each of them, and link individually with hash links on the top of the pages. It also allows us to place slideshows under each block by allowing the client to simply upload the images to an image field, instead of inserting them in the rich text area. The site is responsive, of course8 points
-
This module extends WireMail base class, integrating the PHPMailer mailing library into ProcessWire. Module Directory - Githup repo6 points
-
Here's another website for a German client. http://krafftstoff.de/ Krafftstoff produces textile outfits for promotion, events and fairs. They needed a simple site, mainly to show their portfolio. Our main worry was the variable quality of the images for each project, so we decided to give the great ones a place to shine in the homepage and kept the others limited to a small slideshow on the project pages. The client also asked for a fast and easy way to browse the projects and wanted them to have few information, and that's why we decided to join them in a single page per category, instead of creating a single page per project. Although the views for each project are being created with JavaScript, they are still bookmarkable since we are updating the URL by pushing hashtags. The structure in ProcessWire is extremely simple. There's a page for each of the menu items as children of Home, and the projects ar added as children of each category. The team members are also children pages of te about page. Once again, we only created some example pages, and the client got the hang of it very quickly and completed the content very fast. They seem quite happy wit PW6 points
-
Here you go: new InstagramFeed version 1.0.0 add required scope public_content to retrieve tagged media with getRecentMediaByTag('tag') (thanks @gebeer) add ProcessWire 3.x compatibility add endpoint to get a list of recent comments on a media object: getRecentComments($media) Example: <?php $feed = $modules->get('InstagramFeed')->getRecentMedia(); ?> <div class="instagram> <?php foreach ($feed as $media): ?> <?php if ($media['type'] === 'image'): ?> <a href="<?=$media['link']; ?>" class="instagram-item"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </a> // display comments <?php $comments = $modules->get('InstagramFeed')->getRecentComments($media); ?> <?php if ($comments): ?> <ul> <?php foreach ($comments as $comment): ?> <li><?=$comment['text']?></li> <?php endforeach; ?> </ul> <?php endif; ?> <?php endif; ?> <?php endforeach; ?> </div> A comment ($comment in the example above) contains the following data: "created_time": "1280780324", "text": "Really amazing photo!", "from": { "username": "snoopdogg", "profile_picture": "http://images.instagram.com/profiles/profile_16_75sq_1305612434.jpg", "id": "1574083", "full_name": "Snoop Dogg" }, "id": "420"4 points
-
Excellent write-up Ryan! Here's a quick tip. If you are processing large amounts of data, you should always use PW's field joining options to achieve maximum performance. Even if you only use a single field, you should get around 50% faster execution when the field is joined straight away. With two fields joined, the execution time will be cut into half (i.e. 100% increase in speed). Let's say you need to export the e-mail addresses of thousands of customers. Here's a simplified example using "on-demand" join // Prepare a pointer for writing the output $fp = fopen('customers.csv', 'w') or die('Failed opening the file for writing'); // Ask PW to join two fields (the regular find() also supports this). $options = ['loadOptions' => ['joinFields' => ['customer_email', 'customer_number']]]; // Searching for imaginary customers $selector = 'template=customer'; // Find the pages using the new method foreach($pages->findMany($selector, $options) as $page) { // Write the data in CSV format fputcsv($fp, [$page->customer_number, $page->customer_email]); } // Free the pointer fclose($fp); As a reminder, you can also force some fields to be always joined (through PW admin). @Joer: That is pretty much what the implementation of findMany() does behind the scenes. However splitting the job into smaller batches still makes sense if you use multiple workers to process the data (e.g. for MapReduce or whatever) or if the execution time of your script is limited.3 points
-
2 points
-
If you're interested in running ProcessWire using PHP's built in Webserver this one's for you: <?php /***************************************************************************** * Router script for emulating Apache's "mod_rewrite" functionality. * This router script is designed for testing ProcessWire instances quickly. * Don't use this script and/or PHP's built in Webserver in production. * * Usage: php -S localhost:8000 -t /ProcessWire /ProcessWire/routing.php *****************************************************************************/ $uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); if ($uri !== '/' && file_exists(__DIR__ . $uri)) return false; $_GET['it'] = $uri; // emulate index.php?it=$1 require_once __DIR__.'/index.php'; Enjoy!2 points
-
1 point
-
Thanks Design - Piotr Niescioruk http://avenueagency.eu Implementation - Paweł Kazubski (me) http://avenueagency.eu Pictures - Site owner If you like this site please like it here also https://processwire.com/about/sites/list/claymeeples/1 point
-
This week our focus was on the server side of things rather than on the code side. Sometimes you've got to open the hood and change the oil in order to keep things running smoothly. But rather than just changing the oil, we opted to replace the entire car, moving from our compact family sedan to a turbocharged supercar, so to speak. Basically, we've had some major server upgrades this week! This post covers them in detail: https://processwire.com/blog/posts/web-hosting-changes-and-server-upgrades/1 point
-
1 point
-
Hi Alan, Sorry for the delay in getting back to you. The issue you are seeing is coming from the third-party module SchedulePages. As you are aware, in order to use the auto-(un)publish feature, one has to install this module. However, looking at these lines in the module code, I noticed that whereas it sets a date output and input format, it does not exclusive set a time input format (hence the hh24:06:ss that you are seeing). The solution is simple. Edit the two fields 'publish_from' and 'publish_until'. Specifically, visit their 'Input' Tab and select both a Date and Time Input Format.1 point
-
@Marcel Epp, Currently that's not possible, at least not directly. The only option I see is that you get the output of renderPosts(), and do a string replace on the text at the beginning of the post body, i.e replace <div class="post-body">, prepending your page counter to it. Something like: // the start of the post body to prepend to. This is the string we will search for and replace $str2Replace = "<div class='post-body'>"; // your counter text + appended start of post body $page_counter = "<div class='post-counter'><h4>This is text for your post counter</h4></div>" . $str2Replace; // full post body to search and replace $str2Replace $postBody = $blog->renderPosts($page, 0, $postoptions); // the actual search and replace (prepend) $postBody = str_replace($str2Replace, $page_counter, $postBody); // final output $content = $postBody . $blog->postAuthor() . $renderComments . $blog->renderNextPrevPosts($page);//with post author widget1 point
-
Using FrontendUser and FormHelper modules on dev 3.0.18 here without problems...1 point
-
ProcessPageType is probably the base for ProcessUsers. You can read a bit more about pagetypes here: https://processwire.com/docs/tutorials/using-custom-page-types-in-processwire/1 point
-
Nothing extraordinary here I will try to polish things a bit today and upload a new version. There are a few additions I have in mind to the filter but it's main feature should work fine. Landscape/portrait and size filters could go to the sorting buttons bernhard suggested, once I get to that.1 point
-
For static links you could use AdminCustomFiles and append the links with jQuery. Beyond that you could duplicate and rename the admin theme module and then code in whatever links you need, as I don't think the menu render function is hookable (for the default theme at least). Or a process module, as you say. Also, if by internal links you mean links to edit a particular PW page remember that you can set up page edit bookmarks.1 point
-
Coming from a Rails background years ago, I think it's best to stick with web application frameworks for any web applications that will have heavy iterations and multiple team members. With a webapp framework, you get a testing suite, migrations, ORM, REST, MVC, specific deployment tools and many other necessities. You would have to re-do all those with ProcessWire. Furthermore, using pages to act as a router doesn't feel right. "Use the best tool for the job" and all that.1 point
-
I've already thought of a filter box. Here's a screencap of its current state but it's still in an early stage. It's capable of searching image names, descriptions (multilanguage) and tags, and multiple strings at once (separated by spaces). Filtering worked fine only until name/tag/description were unchanged because filter targets were added on load. I solved this by clicking or focusing on the filter box re-adds all the filter targets. In fact all the filters are added only on the first click so if you don't use the filter it won't add too much overhead.1 point
-
1 point
-
Really nice site! As I always insist on clients, you can't skimp on content quality, really nice photographs accompanying a suitable design!1 point
-
Especially I like the blog entries with LOREM IPSUM in all uppercase Anyway, site is cool and so are the products.1 point
-
1 point
-
Of course the pictures add so much to it... But anyway, this is the 1st site from the forum I've sent a link to my wife to. Cool!1 point
-
They have moved to GrumpyWire and some to ProcessGrumpy because here at PW-Forums are to many friendly and helpful people for them.1 point
-
Sure – where I work at we did exactly that, and haven't looked back since. First of all, it's important to understand that at it's core ProcessWire is a (web) application framework. We prefer to call it a content management framework, but that's not very far from what most web applications do: they store, process, and output content. The way I see it, the main difference to so-called traditional frameworks is that modelling and handling data is a built-in feature, not something you have to reinvent on a case-by-case basis. I have rebuilt a couple of old projects from the scratch using ProcessWire, and in all of those cases this has saved me a lot of time and made most of the model layer obsolete. Before we started using ProcessWire we were doing sites with another CMS and custom applications with Zend Framework. At the beginning I had this idea that we would use ZF for "apps" and ProcessWire for "sites", but in just a few short months we realised that there just wasn't anything we could achieve with ZF that couldn't be done, usually with less work, with ProcessWire. Sure, sometimes we pull other libraries into the mix, but that's not a shortcoming; in my opinion it's just good design Regarding some of the things that have been mentioned here: One thing I was originally missing from Zend Framework was a clearly defined structure. Built-in "one file per template" concept is great for simple sites, but that's just about it. This is why I built the original version of my MVC project. It's not perfect, but it has served us well for years. To get most out of ProcessWire you really should be using it's data modelling abilities. Sure, you can still mock up your own data structures and write SQL to fetch content from the database etc. but that's kind of missing the point: ProcessWire makes data modelling a breeze and the selector engine is both flexible and secure. Some users prefer to build custom management panels, but in my opinion that's another thing you should try to avoid. ProcessWire's admin GUI is flexible and extendable (see Process modules), and again: in most moderately sized projects it can easily save you days of work. For routing you can use page URLs, but I'd also suggest looking into URL segments. For me, coming from the world of Zend Framework, templates are a lot like controllers and URL segments make it easy to implement the concept of actions Try not to invent your own access management system. ProcessWire has a very good implementation of RBAC already in place, and if you need more flexibility, I'd suggest looking into modules such as Dynamic Roles and/or User Groups. Rolling out your own solution is risky, tends to cost a lot, and just generally speaking is a very bad idea. Form validation has been mentioned twice here already. I don't have much insight into this, except that in the beginning we used to build forms using Zend Form, which has it's own validation built-in. That was always a bit tricky (not because of ProcessWire), and these days we use Form Builder for pretty much every form-related need. Sure, it's a commercial module, but it has saved us so much time that the price is absolutely not an issue. In my opinion the answer to your original question is yes and no: ProcessWire can't substitute an application framework because it is an application framework1 point
-
Based on own experience as well as observing some topics on here, I would say "yes, but...". The "but" is that certain things need to be done differently, and other things need to be thought about: Code Where will the code that handles the app's business logic be stored and how will it be structured? Bespoke PW modules or use template files? Data The data that you will be storing - what does it looks like? How will it get from the source into the database? What output or reporting requirements are there? URLs Have one or two main entry points and call your custom code? Or have a new Page for most/all URLs. Automatic page name generation Every page has to have a name, and if many pages will be created using the API what is the naming scheme? Re-use admin vs creating custom front-end There's been some talk about this very recently, and the route chosen may depend on: who your audience is, what level of branding is required, and what functionality is available to who. Having said that a lot of the stuff you need from an app framework is already there. Sessions, Users/Permissions, the data layer, output, templating, and other things I can't remember. One thing I've found missing is a robust generic form validation library. I don't like the config format of valitron, so currently using a slightly modified simple-validator. At my company, we've built various SaaS apps and CMSs over the years using CodeIgniter. More recently though, we have used PW where CI may have previously been chosen. Perhaps an interesting example is a recent project where we used only the PW back-end. The branding was changed a bit, but there was no front-end at all. The main function of the app was to generate an HTML5 product showcase/catalogue/datasheet browser, for use on tablets (built with Backbone JS and JSON datasource). The PW admin was perfect for users managing the data. We built a bespoke Process module for the back-end that allowed users to preview and download the HTML5 app.1 point
-
I guess this puts processwire hosting on the same level as processwire1 point
-
This week we're going to look at our path for growth in 2016, which is already off to a nice start! This includes where we've been, where we're going, and how we will get there–with your help. We actually do have several core updates prepared too, but mostly smaller things that will fit better in next week's post. This post originally started as a section of our 2016 roadmap, but I decided it really deserved its own post, so saved it for this week so that we could cover it more in-depth. However, you might consider this part of, or a continuation of, our 2016 roadmap. But rather than looking internally, much of this post looks externally, outside of our software and community, and into the bigger picture of ProcessWire in the web development/design world. https://processwire.com/blog/posts/growing-processwire-in-2016/1 point
-
I got a client request to make Word template so she can create an image of the weekly menu of a restaurant to post on Facebook. I usually get sick when I have to deal with M$ Word - it's frustration and it's not meant to be used things like that. So I figured out a better system: PW + html2canvas.js. It took more time to finish but it was worth the trouble. The main issues were html2canvas versus some CSS issues, plus switching to different languages in PW on each line. Also, JavaScript cannot offer named downloads, only "download.png", so I had to use HTML5 attribute "download" on links to be able to add custom download filename. I used ProField modules Table and Matrix Repeater which allow very pleasant editing of menu items, even in multilanguage context. Front-end editing is created using the built-in front-end editor. I was about to achieve inline editing of menu items but it soon turned out that repeaters and tables can't be edited this way. Anyway, it's still better compared to my module FEEL because sections are reloaded using Ajax and the admin lightbox shows only the fields I choose. Here's a quick screencap - when the gray background turns to dark gray, then the menu is not HTML but canvas, that can be downloaded.1 point
-
Thanks heaps! Now I can throw away my silly little module made in a hurry. Here is a solution that will email to all your superusers, thanks to LostKobrakai for being there on IRC to give advice: $form->addHookAfter('FrontendUser::save', function() use($fu, $input) { $superusers = wire('users')->find("roles=superuser"); $emails = $superusers->explode('email'); $subject = "A new user registered at the site: " . $fu->userObj->fullname; $emailContentPlain = "Go and activate them: http://www.mysite.fi/myadmin/"; $mail = wireMail(); $mail->to($emails); $mail->from('admin@mysite.fi'); $mail->subject($subject); // plain body $mail->body($emailContentPlain); $mail->send(); }); $fu->process($redirectDestination); Note: wire('pages')->find("template=user.. did not work. It had to be wire('users') !! $fu->userObj->fullname; is getting the value of my extra field, fullname.1 point
-
API to change field settings: $field = $fields->get(164); $value = "newoption\n1=oldoption1\n2=oldoption2"; $module = $modules->get('FieldtypeOptions'); $result = $module->manager->setOptionsString($field, $value, true); var_dump($result); /** * description of function setOptionsString() found in Class SelectableOptionManager.php * Set an options string * * Should adhere to the format * * One option per line in the format: 123=title or 123=value|title * where 123 is the option ID, 'value' is an optional value, * and 'title' is a required title. * * For new options, specify just the option title * (or value|title) on its own line. Options should * be in the desired sort order. * * @param Field $field * @param string $value * @param bool $allowDelete Allow removed lines in the string to result in deleted options? * If false, no options will be affected but you can call the getRemovedOptionIDs() method * to retrieve them for confirmation. * @return array containing ('added' => cnt, 'updated' => cnt, 'deleted' => cnt, 'marked' => cnt) * note: 'marked' means marked for deletion * */1 point