Leaderboard
Popular Content
Showing content with the highest reputation on 05/05/2014 in all areas
-
looks like the imagick resizer module is not set to singleton, and I think it should be: public static function getModuleInfo() { return array( 'title' => 'Imagick Resizer', 'version' => 5, 'summary' => 'A module for replacing GD resizing with Imagick', 'href' => 'https://processwire.com/talk/topic/5889-image-quality-problem-on-resize/', 'singular' => false, 'autoload' => true ); } should be 'singular' => true,5 points
-
Templates without template files are often used to store data. Probably the simplest example is a typical category structure: . |-- home (template=home) |-- blog (template=blog) | |-- blog-post-1 (template=blog-post) | |-- blog-post-2 | |-- blog-post-3 | `-- blog-post-4 `-- categories (template=categories) |-- category-1 (template=category) |-- category-2 |-- category-3 `-- category-4 Those category pages are connected via Page fields to other pages (such as the blog posts in this example), but they're not intended to be visited with their own URLs -- or rendered, so to speak. That's why you don't want them to have template files either. Does this make sense to you?4 points
-
Hi Cairan and welcome to PW. Of course: <img src="{$child->nav_image->url}" /> Although depending on your image settings, you may need to use: $child->nav_image->first()->url Have a read of: http://processwire.com/api/fieldtypes/images/3 points
-
You could also make use of the PW AIOM module: http://modules.processwire.com/modules/all-in-one-minify/ which compiles less on the server automatically.3 points
-
The clue is here: if($page->sidebar) echo $page->sidebar; else echo $homepage->sidebar; It literally means "if this page has a value in the sidebar field, echo that, else echo the sidebar text from the homepage".2 points
-
InputfieldImage does this: L#68 if($this->maxWidth && $pagefile->width > $this->maxWidth) { $pagefile2 = $pagefile->width($this->maxWidth); unlink($pagefile->filename); rename($pagefile2->filename, $pagefile->filename); $pagefile->getImageInfo(true); // force it to reload it's dimensions } if($this->maxHeight && $pagefile->height > $this->maxHeight) { $pagefile2 = $pagefile->height($this->maxHeight); unlink($pagefile->filename); rename($pagefile2->filename, $pagefile->filename); $pagefile->getImageInfo(true); } That's two resizes for me. While questioning if it shouldn't do only 1 resize.2 points
-
Updated PR has been merged into the dev branch. https://github.com/ryancramerdesign/ProcessWire/pull/4572 points
-
I agree with you guys. Actually, last time I checked, current default admin theme had a few quirks with IE8 (one of the reasons we didn't enable it for our clients in the first place), so I don't think we are (or Ryan is) spending much energy towards that anymore. As long as the back-end works properly with IE9, which a lot of our customers are still stuck with, I'm totally happy. When it comes to front-end work, we're using statistics to decide which browsers the sites we build should be most vigorously tested on, and in this regard the situation is pretty good already. According to StatCounter statistics from last 3 months IE8 and IE9, combined, account roughly for 5% of all users around here -- making those a lot less important than IE11, for an example.2 points
-
Hello Vineet! It is sure possible to compile LESS on PHP server and there are basically two projects for this one: https://github.com/leafo/lessphp https://github.com/oyejorge/less.php Leafos is more powerful when it comes to speed but it's not at active development anymore so it's not fully compatible with recent versions of LESS. Downside here is ofcourse that we don't want to compile on every page load and caching is mandatory so there is always some overhead compared to static css file. So if you can use Node.js at your development environment and upload compiled css-files to server it's sure more prefeffed way. If you wan't to give a try we have build custom PHP compiler that uses oyejorges processor for LESS files and it works quite smoothly on live server also: https://github.com/BlowbackDesign/BMin2 points
-
Just guessing that those urls you request don't exist in PW, so you'll get a 404. Solution could be to have url segments enabled for root template. So a url like domain.com/phones if a page /phones/ doesn't exist it won't throw an 404, but just route the request to the home template.2 points
-
This module integrates Swift Mailer mailing library to ProcessWire, providing support for three different "transports" or methods of sending email: SMTP, Sendmail and Mail (essentially PHP's native mail() function). WireMail is email-related base class for ProcessWire. See this post by Ryan for the details. Important thing to note here is that a) it's brand new, so as of this writing you'll need a fresh dev version of ProcessWire to use this and b) it makes integrating new ways of handling email-related tasks very easy. Getting started You can download or clone the module from GitHub: https://github.com/teppokoivula/WireMailSwiftMailer/. Using this module is as simple as downloading / cloning it to your modules directory and installing it. If you're going to use SMTP or Sendmail features, insert correct SMTP credentials / Sendmail command to module settings first. Third transport, Mail, is included simply because it's a native feature of Swift Mailer; if you're going to use it, I would suggest against installing this module. ProcessWire's native WireMail implementation handles this part just fine. Basic usage Sending emails should be done using wireMail() function -- if you use mail() directly, you're going to bypass ProcessWire's email handling features entirely. Main difference between mail() and wireMail() is the order and number of arguments: $number_of_recipients = wireMail($to, $from, $subject, $body); For more information please take a look at README. This module is released under GPLv2 (just like ProcessWire itself) with the exception of included Swift Mailer library, which is copyright © Fabien Potencier and released under the MIT license.1 point
-
Just spotted a PW on Nginx installation tutorial on how-to-forge. I quite like that site - find it useful from time-to-time - so big thanks to Falko Timme for taking time to write it up. Nice1 point
-
I would like to present to you our (the Agency I work for) so far largest Processwire project, that I've built. We've launched it a few month ago, but I had allways forget to post it here. It is a campaign-website of various food-processing companies, located in the northern Germany. The purpose of the site is to present diverse jobs, apprenticeships, traineeships and study programs, which are avaiable in the companies to a wide crowd of young people. On this central point the companies can show how versatile the opportunities in the food-processing industry are. The site is not responsive, but has an alternative Mobile View, which will be displayed, if a "Mobile"-Device/User Agent is identified. Finally, one more big thank to teppo, for his essential advice to make the scaled images happen. foodstarter.de1 point
-
Sorry, Kongondo, typing on my tablet from the allotment. You are lucky that I didn't post it complete with the barrow load of horse shit that I had just picked up.1 point
-
Go to the admin. Edit the page "about". write "lalalalalalalalalalalalalalalalalalalalalalalalalalalalala" in the field called "sidebar". save the page. open the "about" page in the browser.1 point
-
@robinc: which version of ImagickResizer do you use? Above in a code comment from you I have seen v 0.0.5 which is a very early version. regarding to gamma correction with GD in imagesizer: Out there in the wild you can find images with gamma 2.2 and gamma 1.8, (mostly), therefor I have set it to 2.0, because there is no way to detect it with GD. Normally with IMagick using the 16bit colordepth should linearize the gamma setting internally. Manually doing this shouldn't be needed. But I will test this. I have updated my testset and already found some interesting behave. And the gamma test will be the next --- @adrian: I have updated it to version 0.1.5 - And yes, you has set it to singular at the beginning of the project. This was right, but stupid me has changed it.1 point
-
1 point
-
1 point
-
Yes, it was a Dev image I downloaded last night. I see there's a newer one from about 6 hours ago, but I haven't touched that one.1 point
-
2.4.2 is the Dev version I was having problems with. https://github.com/ryancramerdesign/ProcessWire/tree/dev I had pulled 2.4.1 from an earlier time (can't remember what day that was). I keep copies in my download development repository.1 point
-
Soma, Just wanted to say that I appreciate all your hard work on this module—it handles everything I throw at it.1 point
-
I had a similar problem early this morning. I was trying to upload an image to Images Manager and it would not work. This was using the latest version of PW Dev. I struggled with this for a few hours and then reverted my /wire directory to 2.3.12 and then everything worked again (I could upload images). A few minutes ago I uploaded version 2.4.1 and it also worked. I opened an issue on this occurrence in Github.1 point
-
few more things i have noticed regarding gamma issues, by playing with the special image on http://www.4p8.com/eric.brasseur/gamma.html Even with the correct gamma correction before/after resize, GD2's jpeg encoding at 100% quality is still appalling - mangles images that if saved as pngs are fine. (took me a while to isolate as artifacts can look similar as if the gamma was incorrect). Using Imagick, I still need to add in the gamma correction similarly to that in ImageSizer.php. (which i think should be 2.2, not 2.0 as hardcoded). The default getImageGamma() for a new Imagick object is coming up as 1/2.2 (0.454545), which still needs to be added again via $im->gammaImage() to correctly linearize for resizing. (ie. not do gammaImage(2.2) to push it back to 1 before resizing). Hope this makes sense. $this->imageGamma = $this->im->getImageGamma(); if ($this->imageGamma && $this->imageGamma!=1) { $this->im->gammaImage($this->imageGamma); } // resizeImage(), sharpen, etc // ...... if ($this->imageGamma && $this->imageGamma!=1) { $this->im->gammaImage(1/$this->imageGamma); }1 point
-
@horst - great job on this - I will try to test soon. One thing I just noticed is that singular is still set to false in the version posted to Github.1 point
-
1 point
-
To put it another way: A template is the structure for a particular data set.. A page is one row of data If you want to display any of that data you need to call it using the ALI A template file associated with the template allows you to call from that page without having to specify the page - it returns that particular page1 point
-
Hi Beluga, Thanks for sharing that link. Very interesting. I've made a basic PM tool using PW, I'll be expanding it little more for a client's project. I'll post it here once it's ready. For now it's just a simple task management system. If anyone's interested, feel free to contact me, I've a demo online which I'm using to manage my company's projects. Have a great day!1 point
-
Thanks for the quick replies. @Soma, enabling url segments is a great idea (wish I'd thought of it) and it did the trick. The way it ends up as far as URLs go, is like this: http://example.com/pw-managed-page/#/start-of-angular-routes. The code for my router configuration is like this: var MyAppRoutes = angular.module('MyApp', ['ngRoute']); function routeConfig($routeProvider) { $routeProvider. when('/start-of-angular-routes', { // note that it DOES NOT include the pw-mananged-page controller: AppController, templateUrl: '/ng-templates/app-template/' //don't link to file system html pages }). otherwise({ redirectTo: '/not-found' // angular managed page not found }); } MyAppRoutes.config(routeConfig); Thanks so much for your help. Much appreciated.1 point
-
Delving deeper in the module code CREATE TABLE {$this->className} ( session_id VARCHAR(255) NULL, last_modified TIMESTAMP NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, items TEXT NULL, total_sum FLOAT(10,2) NULL, user_id INT NULL, PRIMARY KEY (`session_id`) ) class ShoppingCart extends WireData implements Module, ConfigurableModule it turns for that this code creates a table with name 'shoppingcart' instead of 'ShoppingCart' when run on my local wamp machine, but when run directly on my server xamp it creates 'ShoppingCart'. And i got the problme because i ported from my local to server machine, so carried 'shoppingcart' table , which when called on local machine worked surprsiingly for some reason but on server its case-sensitive.1 point
-
For prices I would suggest to go with float input and then modify the output when ever needed. Text field for numeric data is not the sharpest solution. With float you can be sure that data is always numeric only, can have decimals and calculations with PHP work without hassle. For output you can use some basic function like this: function price($float) { return number_format($float, 2, ',', '') . "€"; } If you need to add taxes it's also easy extend to the output function: function price($float, $tax=null) { if($tax) $float = $float * ((int) $tax / 100 + 1); return number_format($float, 2, ',', '') . "€"; }1 point
-
I guess the problem lies on database naming: ShoppingCart vs. shoppingcart1 point
-
1 point
-
Hi onjegolders Ah, I haven't been aware, that there is also this possibility. I have always thought, you would have to create all the pages first, in order to use them on pages. As always: PW is far easier than you would think. Thanks onjegolders. You've made my day.1 point
-
Hari KT, you may be interested in testing the module I have been working on to deliver this functionality - LoginPersistent.1 point
-
Oops, for some reason, the module isn't detecting my custom CSS file. My path is correct: site/templates/notes/notes.css and the file exists when I visit it in a browser. I'm using PW 2.4.0.1 point
-
I managed to add this functionality to my local copy of PW. Will make a pull request out of it this evening and submit it to Ryan for his consideration. Update: PR submitted.1 point
-
1 point
-
I have several ideas in mind for directory-based websites, and came across ProcessWire in my search for a starting point about a year ago. There are several good WordPress themes that are commercially available, but all the ones I've seen have various limitations that would preclude their use for what I have in mind. As a starting point for experimenting with ProcessWire, I had access to a list of churches and used that to develop a map-based directory here: Baptist Blue Book. The central issue for me was the map interface, and how to handle a reasonably large number of listings (~6,000) in that view (Most of the WordPress themes I had come across restricted the map view to a certain city, which I suspect was to limit the number of markers that had to be loaded.) A few notes: I'm using Ryan's Form Builder to accept suggestions for new listings. I liked having the packed solution for this, and the ability to control what happened to those submissions on the back end (e.g., the ability to hold them in a queue for review rather than posting immediately to the site). The church pages are subdivided by state (e.g., Directory > Texas > [church name]) by using a script to push a new listing to the proper sub-directory once it's approved. In hindsight, this may be an overly limiting approach, particularly for adapting it to international use, but once I had started on that path I needed to stick with it and focus on other issues. For the map view, a separate script pulls the latitude, longitude, and page-id from all listings and caches that in a JSON file. When the Map page is viewed, that file is retrieved and used to generate the markers. The content for the popups is only loaded as needed to minimize bandwidth. (Side note: I'm using MapBox for this, along with Leaflet and the MarkerCluster add-in.) All in all, I've been very pleased with the flexibility of ProcessWire, as well as the helpfulness of the community. I've also noticed several directory-type sites listed in the showcase, so I'm wondering if it might be useful to develop a module tailored to that application (or is each one so unique that this would not be feasible)? Any comments or feedback would be welcome. Brian1 point
-
Hey OrganizedFellow, Thanks for bring this to attention I had completely forgotten about it. I'll keep updating with what I've learnt so far! Thanks.1 point
-
@teppo: I think logging is mandatory, even if you throw an exception. Also doing an automated fallback from SMTP to php-mail, without the users knowing isn't good in my opinion. Per default I would raise an error (and log it), but would give a configuration setting under advanced (or something) where the user have the possibility to enable that useful behave. If he check that option, _he_ has done so and not _you_, means he has at least be informed about that behave one times. I'm a big fan of (automated) corrections for the user with missconfigurations, but with emails are a million possibilities given. Maybe on a company site they must use SMTP through a special company server to send company-internal messages, it could be that there are very restrictive settings and a mail from php-mail gets blocked and never reaching the recipients. (Sure, a rare case, but may be possible).1 point
-
Thanks Teppo, this is great! I'm looking forward to using this one. I did try to install but ran into some troubles. I was unable to get it to save SMTPServer or SMTPPort. I tracked that down to an issue with field dependencies (in the core, not your module). I've now fixed that in the core, but you may want to remove the requiredIf condition from those two fields if possible, at least temporarily, as I need to do more testing with the core changes I made before committing to GitHub. Once I was able to save the SMTPServer and SMTPPort settings, I tried to use the module but keep getting this message: Fatal error: Class 'Swift_Message' not found in /Volumes/RyMain/Users/ryan/htdocs/cpi/site/modules/WireMailSwiftMailer/WireMailSwiftMailer.module on line 261 It looks like this condition is failing somehow: if ($this->transport != "Smtp" || $this->SMTPServer && $this->SMTPPort && $this->senderAddress) If I remove that line above (as well as the closing brace further in the function) then I no longer get errors. Following that, I configured it for Gmail per the instructions you linked to. The instructions said to choose "SSL/TLS". I chose "TLS" first, but that didn't work. So next I tried "SSL", and that worked. So SMTP setup is now working for me and it seems to work great. Some other things to mention: 1. The module should not be autoload, if possible. WireMail is intended to be loaded on demand rather than on every request. 2. The module should not be singular, if possible. When someone makes a call to wireMail(), we want to make sure we're returning them a brand new copy rather than one that might already have some email settings populated in it. That's why singular should be false, so that every time the module is retrieved a new instance is born. 3. The module version number shouldn't have preceding zeros, as this starts PHP thinking it's an octal number or something else (I don't recall). So version number should be 6 rather than 006. 4. The require() statement in your init() function should likely be a require_once(), and it should ideally include the full path, just in case another copy of of the same directory name exists elsewhere in the PHP path. i.e. require_once(dirname(__FILE__) . '/Swift-' . self::SWIFT_VERSION . '/lib/swift_required.php');1 point
-
Due to scope, you need to use wire('config') inside a function. Same is true for all the PW variables: http://processwire.com/api/variables/ If you'll be using it a lot in the function, you can do $config = wire('config') and then use $config as normal after that.1 point
-
Works with many to many too. $prs = $pages->find("title=Zoo|Theme park|Museum"); // maybe also use the name or id $poi = $pages->find("template=poi, poi_type=$prs"); EDIT: corrected code. yours doesn't work because "get" will return only 1 page and not page array.1 point
-
Ryan, Many thanks for this module, I just used it to add 436 users. There were a small handful of things that weren't initially clear, so I detailed them below for anyone else trying to import users. If you plan to import passwords, you need to open the module and add FieldTypePassword to $fieldtypes protected $fieldtypes = array( 'FieldtypePageTitle', 'FieldtypeText', 'FieldtypeTextarea', 'FieldtypeInteger', 'FieldtypeFloat', 'FieldtypeEmail', 'FieldtypeURL', 'FieldtypeCheckbox', 'FieldtypeFile', 'FieldtypePassword', // add this line ); Since users are pages and all pages require a title, your CSV will need to have a title column. In my case, I duplicated all the usernames into that column — so name and title are the same. In order for title to show as a connection option during your import, you need to add the title field to the user template file. To do this, go to: Setup > Templates (open the filters area at the top, and choose "show system templates". Select the user template and add the title field. One other thing to note, be sure to have a roles column in your CSV with roles for each user. I forgot that during my first test import and all the users were set to guest. You should be all set to import your users.1 point