Leaderboard
Popular Content
Showing content with the highest reputation on 06/04/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/7 points
-
Until Ryan can come up with something more elaborate I'll just share a snippet of him here. In template files you'll just need the part beginning with $config2 …. <?php namespace ProcessWire; // This file is named /nstest/multi-instance.php // and it exists in the first test installation // loaded at: http://localhost:8888/nstest/multi-instance.php echo "<pre>"; include("./wire/core/ProcessWire.php"); // Test first instance: /nstest/ $config = ProcessWire::buildConfig(__DIR__); $wire = new ProcessWire($config); $items = $wire->pages->find("id>0, include=all"); foreach($items as $item) { echo "$item->url\n"; } echo "\n---------------------\n"; // Test second instance /xyz/ $config2 = ProcessWire::buildConfig(realpath("../xyz/"), '/xyz/'); // LostKobrakai: Not sure, but I need this next line for it to work $config2->paths->modules = $config->paths->modules; $wire2 = new ProcessWire($config2); $items = $wire2->pages->find("id>0, include=all"); foreach($items as $item) { echo "$item->url\n"; } echo "\n---------------------\n"; // Test first instance again foreach($wire->pages->find("body*=about") as $item) { echo "$item->url\n"; } A working example of that is running here, where the images are pulled from my photography page: https://www.kobrakai.de/ Edit: Now it's also visible (missed to uncache the page).3 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 course2 points
-
$page = $event->object->getPage();2 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 PW2 points
-
2 points
-
Wire Mail SMTP An extension to the (new) WireMail base class that uses SMTP-transport This module integrates EmailMessage, SMTP and SASL php-libraries from Manuel Lemos into ProcessWire. I use this continously evolved libraries for about 10 years now and there was never a reason or occasion not to do so. I use it nearly every day in my office for automated composing and sending personalized messages with attachments, requests for Disposition Notifications, etc. Also I have used it for sending personalized Bulkmails many times. The WireMailSmtp module extends the new email-related WireMail base class introduced in ProcessWire 2.4.1 (while this writing, the dev-branch only). Here are Ryans announcement. Current Version 0.8.0 (from 2024-09-25 -- initial version 0.0.1 was pushed on 2014-03-01) Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md Downlod: get it from the Modules Directory || fetch it from Github || or use the module-installer in PWs admin site modules panel with its class name "WireMailSmtp". Install and Configure Download the module into your site/modules/ directory and install it. In the config page you fill in settings for the SMTP server and optionaly the (default) sender, like email address, name and signature. You can test the smtp settings directly there. If it says "SUCCESS! SMTP settings appear to work correctly." you are ready to start using it in templates, modules or bootstrap scripts. Usage Examples The simplest way to use it: $numSent = wireMail($to, $from, $subject, $textBody); $numSent = wireMail($to, '', $subject, $textBody); // or with a default sender emailaddress on config page This will send a plain text message to each recipient. You may also use the object oriented style: $mail = wireMail(); // calling an empty wireMail() returns a wireMail object $mail->to($toEmail, $toName); $mail->from = $yourEmailaddress; // if you don't have set a default sender in config // or if you want to override that $mail->subject($subject); $mail->body($textBody); $numSent = $mail->send(); Or chained, like everywhere in ProcessWire: $mail = wireMail(); $numSent = $mail->to($toEmail)->subject($subject)->body($textBody)->send(); Additionaly to the basics there are more options available with WireMailSmtp. The main difference compared to the WireMail BaseClass is the sendSingle option. With it you can set only one To-Recipient but additional CC-Recipients. $mail = wireMail(); $mail->sendSingle(true)->to($toEmail, $toName)->cc(array('person1@example.com', 'person2@example.com', 'person3@example.com')); $numSent = $mail->subject($subject)->body($textBody)->send(); The same as function call with options array: $options = array( 'sendSingle' => true, 'cc' => array('person1@example.com', 'person2@example.com', 'person3@example.com') ); $numSent = wireMail($to, '', $subject, $textBody, $options); There are methods to your disposal to check if you have the right WireMail-Class and if the SMTP-settings are working: $mail = wireMail(); if($mail->className != 'WireMailSmtp') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; return; } if(!$mail->testConnection()) { // Connection not working: echo "<p>Couldn't connect to the SMTP server. Please check the {$mail->className} modules config settings!</p>"; return; } A MORE ADVANCED DEBUG METHOD! You can add some debug code into a template file and call a page with it: $to = array('me@example.com'); $subject = 'Wiremail-SMTP Test ' . date('H:i:s') . ' äöü ÄÖÜ ß'; $mail = wireMail(); if($mail->className != 'WireMailSmtp') { echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; } else { $mail->from = '--INSERT YOUR SENDER ADDRESS HERE --'; // <--- !!!! $mail->to($to); $mail->subject($subject); $mail->sendSingle(true); $mail->body("Titel\n\ntext text TEXT text text\n"); $mail->bodyHTML("<h1>Titel</h1><p>text text <strong>TEXT</strong> text text</p>"); $dump = $mail->debugSend(1); } So, in short, instead of using $mail->send(), use $mail->debugSend(1) to get output on a frontend testpage. The output is PRE formatted and contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection, like this one: Following are a ... List of all options and features testConnection () - returns true on success, false on failures sendSingle ( true | false ) - default is false sendBulk ( true | false ) - default is false, Set this to true if you have lots of recipients (50+) to ($recipients) - one emailaddress or array with multiple emailaddresses cc ($recipients) - only available with mode sendSingle, one emailaddress or array with multiple emailaddresses bcc ($recipients) - one emailaddress or array with multiple emailaddresses from = 'person@example.com' - emailaddress, can be set in module config (called Sender Emailaddress) but it can be overwritten here fromName = 'Name Surname' - optional, can be set in module config (called Sender Name) but it can be overwritten here priority (3) - 1 = Highest | 2 = High | 3 = Normal | 4 = Low | 5 = Lowest dispositionNotification () or notification () - request a Disposition Notification subject ($subject) - subject of the message body ($textBody) - use this one alone to create and send plainText emailmessages bodyHTML ($htmlBody) - use this to create a Multipart Alternative Emailmessage (containing a HTML-Part and a Plaintext-Part as fallback) addSignature ( true | false ) - the default-behave is selectable in config screen, this can be overridden here (only available if a signature is defined in the config screen) attachment ($filename, $alternativeBasename = "") - add attachment file, optionally alternative basename send () - send the message(s) and return number of successful sent messages debugSend(1) - returns and / or outputs a (pre formatted) dump that contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection. (See above the example code under ADVANCED DEBUG METHOD for further instructions!) getResult () - returns a dump (array) with all recipients (to, cc, bcc) and settings you have selected with the message, the message subject and body, and lists of successfull addresses and failed addresses, logActivity ($logmessage) - you may log success if you want logError ($logmessage) - you may log warnings, too. - Errors are logged automaticaly useSentLog (true | false) - intended for usage with e.g. third party newsletter modules - tells the send() method to make usage of the sentLog-methods - the following three sentLog methods are hookable, e.g. if you don't want log into files you may provide your own storage, or add additional functionality here sentLogReset () - starts a new LogSession - Best usage would be interactively once when setting up a new Newsletter sentLogGet () - is called automaticly within the send() method - returns an array containing all previously used emailaddresses sentLogAdd ($emailaddress) - is called automaticly within the send() method Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md1 point
-
+1 on the Multi-Instance feature and documentation.1 point
-
Thank you all for your answers. @cstephensjr different values make no difference... i'll try to contact my vserver hoster1 point
-
I'm really looking forward to "multi-instance" docs No pushing..just letting everybody know about my interest hehe1 point
-
LostKobrakai, thanks for help! Final solution wire()->addHookBefore("ProcessPageEdit::processSaveRedirect", function(HookEvent $event) { $url = $event->arguments(0); $page = $event->object->getPage(); if($page->template->name == 'blog-entry') { if($url == "../") { $goto = wire("pages")->get(3062)->url; $event->arguments = array($goto); } } });1 point
-
1 point
-
With a normal file or image field it will not let you save an empty "Valid File Extensions". It would seem to be a great idea, however I believe it would open many ProcessWire websites up to being hacked due to the actions of unsavory actors if it is enabled from the start. It's a vulnerability that would be easily exploited if the developer has not taken prudent actions to sanitize the input (files/images). The majority of knowledgeable developers would be aware of the danger, but that's not always the case. Making it a configurable option that you would have to explicitly enable would be a way to make it possibly work.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
-
There was a little adjustment to be compatible with 3.0 in the past. @mr-fan Thanks for helping out with support here1 point
-
Another way is to insert it via JavaScript. Note, this example is tested for the default admin theme, not Reno. First place the following in your admin.php file above the require controller line, inside your templates dir: $config->scripts->append($config->urls->templates."admin.js"); Then place the following in a file called admin.js in your templates dir: $(document).ready(function(){ $('#topnav').append('<li><a href="https://example.com/" target="_blank">Example</a></li>'); }); I'm sure the jQuery could be more elegant, but the point is it can be done via JS as well, which I ended up doing for a recent project for reasons I can't remember. In my specific example, I linked it to a Google Doc which contained help documentation for a site.1 point
-
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
-
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!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
-
The latest update (v010) can remove the masthead from the Reno theme. This is available only if sticky header is on. In fact this feature uses another approach for the sticky header because only the main content is scrollable, which perhaps makes it easier to see whether the page is scrolled down or not. For the Reno theme there is a new setting "AlwaysShowSearch". Other dropdown buttons are now also supported in the HoverSaveDropdown tweak. Remind me next time not trying to modify a cloned button instance because it won't work There were numerous tweaks made to the admin configuration screen. Nested checkboxes now can't be modified if their parents are not checked, and also some space were saved by playing with field/fieldset options.1 point
-
v009 comes with a small feature update: ctrl+click on a language tab will activate all the language tabs of the same language. This is great for switching the current admin page fields to another language, eg. for checking contents of multiple fields at once.1 point
-
v008 is committed to GitHub and it enables showing the Save dropdown menu on hover instead of on click. The only way I found to achieve this is adding a CSS class to the dropwdown which seems to work fine with the exception of Module config pages. Anyway, it covers 99% of the usage scenarios I think. More agressive modifications were dropped because the markup wasn't generated the way I initially thought and it would be hard to solve.1 point
-
With PW 3.0.18 there were again major changes in the code of the core images field that renders the intermediate version invalid, (again). So, atm it doesn't make much sense and also I don't have the time to find a way how to implement the croppable images functionality into the new images field. At least, because there is no easy interface or hooking point supported to archive that. One possible solution could be to make the old core images field a third party module, so that the crop tools can extend this as it was before. Ryan mentioned this somewhere already. Another solution, what I would prefer is, what @Martijn suggested: https://processwire.com/talk/topic/13279-pw-3018-yet-more-images-field-upgrades/#entry1200971 point
-
Is this already in, "crop sizes from presets"? If we could have that with the core images field, it would make the croppable images obsolete, what I think would make things much easier. We only would need one images fieldtype and optionally can define "presets" or not. Wouldn't it? +11 point
-
Awesome update! But one feature request: Optional disable crops with flexible widths & heights' and enable crop sizes from 'presets'.1 point