Leaderboard
Popular Content
Showing content with the highest reputation on 04/09/2016 in all areas
-
@tewdin, Easy, yes - but not that easy. Please add input sanitisation and return value checks to your code posted above. I think you should also be getting the values from Post input, not from request input. If you have live code like the example you posted, you should probably revise it.6 points
-
Hello, guys! I've started a new series of screencasts about ProcessWire. They are in german, if there is any interest I could record also the English version. Processwire is such a great CMS, I'm totally in love So I'm trying to convince more people to use it. https://www.youtube.com/channel/UCwkKKtIeOzfIqF8X5gNP0_g3 points
-
Thank you! I could compare PW to MODx only. And Wordpress is not a CMS.. I never worked with any different CMS . I don't know which CMS I would choose if I had to decide between MODx and ProcessWire. Both are powerful and have their advantages and disadvantages.2 points
-
Although in the case of real projects I find it nearly impossible to produce HTML output that is considered to be valid by the W3 validator, I think it is a good idea to have a quick look so that anything considered to be a bug (say not closed elements) can be quickly identified. So I support the idea.2 points
-
2 points
-
Getting closer to the ProcessWire 3.x stable release, version 3.0.14 focuses largely on updates and optimizations specific to recent GitHub issue reports. We also have optimizations and in-depth coverage of PW’s file compiler, some new options for required fields, along with a review of some best practices when working with fields. https://processwire.com/blog/posts/processwire-3.0.14-updates-file-compiler-fields-and-more/1 point
-
Function Allows all admin-side text areas to auto-expand as they are used. Description Following on from tpr's mini-tutorial, I went ahead and wrapped it up as a module. I'm re-posting it here in the module's forum and will submit it to the module repository to prevent it from becoming one of PW's "ghost" modules - modules for PW that exist on github (or elsewhere) and have a relatively obscure link from the forum or a blog post somewhere else. Links The module on Github. The module in the module repository. Version History 1.0.0: Initial release.1 point
-
Probably better examples floating around too, but the execute() method in ProcessLinkChecker.module loads JqueryWireTabs, creates a new InputfieldWrapper, and adds child inputfields. In this case children are created by separate build* methods, but you could also create them in the execute() method itself. In this case I need to create multiple similar inputfields, and separate methods help me avoid code repetition. There might be a better way to do this, but in this case I had to trigger the tab feature myself. This is done in ProcessLinkChecker.js, and the target is the original InputfieldWrapper element created by execute() method of ProcessLinkChecker.module. This is why I had to load JqueryWireTabs in the Process module, by the way. You can display fields conditionally by using showIf rules. Something like this, perhaps: public function execute() { $fields = new InputfieldWrapper; $field = new InputfieldCheckbox; $field->name = "field_a"; $fields->add($field); $field = new InputfieldText; $field->name = "field_b"; $field->showIf = "field_a=1"; $fields->add($field); return $fields->render(); } Edit: I'm moving this topic to module development subforum. Modules forum is intended for module support threads, while the module development subforum is where we can discuss development practices etc.1 point
-
and if you want to retrieve an image by name $article->product_image->get("name=picture.jpg")->url1 point
-
A pro would be, to have it into the TracyDebugger toolbox makes it independant from your own browsers and its extensions. Useful in the more rare cases, where you are using a foreign PC. So, it should be in, but disabled by default.1 point
-
The real question is, why you want to do this with module? Creating a simple contact form is easy. <?php$action=$_REQUEST['action']; if ($action=="") /* display the contact form */ { ?> <form action="" method="POST" enctype="multipart/form-data"> <input type="hidden" name="action" value="submit"> Your name:<br> <input name="name" type="text" value="" size="30"/><br> Your email:<br> <input name="email" type="text" value="" size="30"/><br> Your message:<br> <textarea name="message" rows="7" cols="30"></textarea><br> <input type="submit" value="Send email"/> </form> <?php } else /* send the submitted data */ { $name=$_REQUEST['name']; $email=$_REQUEST['email']; $message=$_REQUEST['message']; if (($name=="")||($email=="")||($message=="")) { echo "All fields are required, please fill <a href=\"\">the form</a> again."; } else{ $from="From: $name<$email>\r\nReturn-path: $email"; $subject="Message sent using your contact form"; mail("info@tewdin.com", $subject, $message, $from); echo "Email sent!"; } } ?>1 point
-
I think mobile content should load fast and every useless piece should be disabled if possible. But I don't really understand why we can't just do everything AMP style and forget the old ways? Browsers can support it and if I don't have any elements which are banned, then why should I do normal page? I want always optimise my content and websites, but I don't really like double content or double work. I can confirm that LostKobrakai's way to do this seems to be best practise but I think fixing only the elements that needs to be fixed is a better way than put everything to AMP or normal. At least for me because I have a lot of templates and code. I just do my first AMP version. This is not nice for me because I always put YouTube video to top of the page (embed video - title - info - body), because that is very important for me. So now it must be the last.1 point
-
Try it like this (notice the curly braces where the url of the first image is retrieved): echo "<a class='gallery' title='$article->title' href='$article->url'> <img src='{$article->product_image->first()->url}'> </a>\n"; Of course, you could simply move the PHP code outside of the string: <img src= '" . $article->product_image->first()->url . "'> If you want to retrieve the url of the second image, you can use $article->product_image->eq(1)->url.1 point
-
Browser extensions? I'm not sure if this feature is worth a (sub)module, unless it provides some benefits over them.1 point
-
1 point
-
Thanks again, Ryan! For the update and for educating us (best practices with fields...).1 point
-
Terrific site! Congratulations to you and the team. My suggestion if to try to compress images a bit more, maybe using minimize.pw to automate the process. And enable GZIP for the static files.1 point
-
1 point
-
Whew! I got help from Caddy developer abiosoft and now I have a working ProcessWire config! It is included below. Note certain things: - the "php" in the fastcgi line defines a preset, so we don't need to use any "ext" stuff. - the new style rewrite which does not use {uri}: to {path} {path}/ /index.php?it={path}&{query} Abiosoft is also looking into a webtrees instance I have. So far the routing is solved by a workaround of adding a /slash to a certain line the webtrees index.php. Once the issue is solved properly, I can publish the Caddy config on the webtrees forum I urge everyone using Caddy with PW to donate bitcoins to abiosoft! https://mysite.com, https://www.mysite.com { root /wherever/your/files/are fastcgi / unix:/var/run/php-fpm/php-fpm.sock php internal /forbidden rewrite { r /\. to /forbidden } rewrite { r /(COPYRIGHT|LICENSE|README|htaccess)\.txt to /forbidden } rewrite { r ^/site(-[^/]+)?/assets/(.*\.php|backups|cache|config|install|logs|sessions) to /forbidden } rewrite { r ^/site(-[^/]+)?/install to /forbidden } rewrite { r ^/(site(-[^/]+)?|wire)/(config(-dev)?|index\.config)\.php to /forbidden } rewrite { r ^/((site(-[^/]+)?|wire)/modules|wire/core)/.*\.(inc|module|php|tpl) to /forbidden } rewrite { r ^/(site(-[^/]+)?|wire)/templates(-admin)?/.*\.(inc|html?|php|tpl) to /forbidden } # GLOBAL rewrite { to {path} {path}/ /index.php?it={path}&{query} } log /var/log/www/access.log { rotate { size 50 age 7 keep 5 } } errors { log /var/log/www/error.log { size 50 age 7 keep 5 } } }1 point
-
I am currently managing a PW site with 2 million+ pages. It's admirably fast, and much, much faster than any other CMS we tested. Searching is also ridiculously fast when done on single fields like title. (I also just did a test search using the page finder and it took < 4 seconds to find pages which had a particular field empty from a template which has 1.63 million pages.) The site doesn't deal with many image or file uploads (yet), but two optimizations I have applied so far are to 1) always, always use limits on using $pages->find(), and 2)to cache the sitemaps (which contain thousands of links each) using Procache(https://processwire.com/api/modules/procache/) Once you know where specifically your site is using the most resources, you can apply more selective caching / database optimizations. Thanks for starting this topic, I learned about pageFileExtendedPaths... there's always some cool feature I didn't know about and now must have!1 point