Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/28/2018 in all areas

  1. If anybody wants to give it a try, here's a little attempt at an OR-group capable PageArray extension (just to see if this might be worth investing some more time and creating a PR). Usage: $regularPageArray = $pages->find("template=mytemplate"); // Returns an OrGroupsPageArray instance with the contents of $regularPageArray: $groupable = $regularPageArray->getGroupable(); $groupable->filter("fieldA=1, (fieldB=today), (fieldB=tomorrow)"); // or $filtered = $groupable->find("fieldA=1, (fieldB=today), (fieldB=tomorrow)"); OrGroupsPageArray.zip
    4 points
  2. if you want to see the MSSB in action, these pages all use it: http://www.rogershapirofund.org/blog/ https://www.elliottcarter.com/news/hommage-a-elliott-carter-ensemble-intercontemporain/ https://www.williamanderson.us/blog/manufacturing-innocence/
    3 points
  3. I think there should be an annual award for best module.
    2 points
  4. Not necessary I think. As far as I know PageArrays are always unique (they never contain the same page more than once).
    2 points
  5. Just an FYI that PW actually disabled the strict setting to avoid this error. This is something that I think should be changed in the future. I dealt with upgrading a lot of complex queries on a non-PW project a while ago and it can be a pretty painful migration - in some cases the results can actually be quite different so some caution is definitely needed.
    2 points
  6. This means that your MySQL server is in strict mode regarding group by expressions. MySQL used to be rather lenient there, but normally standard SQL requires that you name all non-aggregate (SUM, COUNT, AVG etc.) columns that appear in the SELECT clause also in the GROUP BY expression. Since along version 5.6, the ONLY_FULL_GROUP_BY settings was enabled as a default, and nowadays many hosters and Linux distributions also set this flag in installations of 5.5. Your "SELECT *" include the columns id, member_name, member_id and member_score, so for MySQL it looks like: SELECT id, member_name, member_id, member_score FROM golfscores GROUP BY member_id LIMIT 0, 1000; To understand why MySQL complains, you have to understand what MySQL does under the hood: It scans through the member_id column (or its index) for all unique values. For any of the other columns, since they aren't in the group by, it picks the first value it finds in a row found in the first step. This means, in your example data, it might find a member_score of either 30 or 38 for member_id 222. Which one it finds first and returns is pure chance. Since the SQL standard desires predictability and doesn't like chance at all, such a behavior is unacceptable. Very few databases allow such a thing at all. On the other hand, if you, as the developer, know that mismatched rows like in your example cannot be found in the database (i.e. only one combination for id, member_name and member_score is in the table for each member_id), grouping just by member_name tells MySQL "don't worry about checking uniqueness and order of the other columns, just return the first hit for each member_id" and saves the database server (sometimes quite) a bit of lookup work for those columns. This is, of course, a bit dangerous. Thus, the ONLY_FULL_GROUP_BY setting was switched on at some point. You can switch it off per connection, or globally for all new connection through a SET statement, but these won't be persisted (PW does this every time it initializes a database connection). If you want to use that optimized group by syntax, the best way is to do it in my.cnf (the server configuration). Somewhere there, you will find line in the [mysqld] section with the sql_mode. Remove ONLY_FULL_GROUP_BY from that line. /* MySQL < 5.7.x */ sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY /* newer MySQL */ sql-mode="NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY" Make sure to keep the format (underscore vs. dash, no quotes vs. double quotes) the same and restart the server.
    2 points
  7. This module is improved and extended successor to Version Control For Text Fields. It handles everything it's predecessor did -- providing basic version control features for page content -- and quite a bit more. Download or clone from GitHub: https://github.com/teppokoivula/VersionControl. This module requires ProcessWire 2.4.1 or later, mostly because of the file features, which require certain Pagefile and Pageimage methods to be hookable. There's no sensible way around this limitation; for those stuck with < 2.4.1, Version Control For Text Fields will remain a viable option. What does it do? While editing pages, fields with old revisions available show up with a new icon in their header bars. By hovering that icon you get a list of available revisions and by clicking any one of those the value of that particular field is reverted to that revision. No changes are made to page until you choose a revision and save the page, which means that you can keep switching between revisions to get an idea what's really changed without inadvertently causing any content to change. The module also adds a History tab to page edit. This tab opens a view to the history of current page in the form of "revisions" -- each of which is a group of changes to page fields processed during one page save (similar to revisions in various source control applications). There are three actions you can perform on these revisions: adding comments, live previewing what the page might've looked in that revision and restoring the page to specific revision. One specific feature that has been a big thing for me personally is support for file (and image) fields, as the original version control module felt rather incomplete without it. I'm hoping to take this a lot further performance, stability and feature wise, but as it stands right now, it's already included here and should be fully functional. Watch the video preview here I prepared a little screencast outlining most of this: http://youtu.be/AkEt3W7meic. Considering that it was my first screencast ever, I'd like to think that it wasn't that bad.. but I might give it another shot at some point, this time planning a bit before hitting "record" Upgrading from Version Control For Text Fields For those already using Version Control For Text Fields, I've added something extra. If you upgrade that module to it's latest version, you should see a new checkbox in it's settings screen saying "Don't drop tables during uninstall". If you check this, uninstall the module and then remove it's files (this is required in order to install Version Control), your old data should be automagically imported to Version Control. Import has only been tested with limited amounts of demo data. Proper tests are yet to come, so please be careful with this feature! Update, 21.6.2015: as of today, this module is no longer in beta. While all the regular warnings still apply (making changes, including installing any new modules, on a production site should always be considered risky) Version Control has gone through pretty extensive testing, and should be as stable as any other module out there.
    1 point
  8. Presentation Originaly developped by Jeff Starr, Blackhole is a security plugin which trap bad bots, crawlers and spiders in a virtual black hole. Once the bots (or any virtual user!) visit the black hole page, they are blocked and denied access for your entire site. This helps to keep nonsense spammers, scrapers, scanners, and other malicious hacking tools away from your site, so you can save precious server resources and bandwith for your good visitors. How It Works You add a rule to your robots.txt that instructs bots to stay away. Good bots will obey the rule, but bad bots will ignore it and follow the link... right into the black hole trap. Once trapped, bad bots are blocked and denied access to your entire site. The main benefits of Blackhole include: Bots have one chance to obey your site’s robots.txt rules. Failure to comply results in immediate banishment. Features Disable Blackhole for logged in users Optionally redirect all logged-in users Send alert email message Customize email message Choose a custom warning message for bad bots Show a WHOIS Lookup informations Choose a custom blocked message for bad bots Choose a custom HTTP Status Code for blocked bots Choose which bots are whitelisted or not Instructions Install the module Create a new page and assign to this page the template "blackhole" Create a new template file "blackhole.php" and call the module $modules->get('Blackhole')->blackhole(); Add the rule to your robot.txt Call the module from your home.php template $modules->get('Blackhole')->blackhole(); Bye bye bad bots! Downloads https://github.com/flydev-fr/Blackhole http://modules.processwire.com/modules/blackhole/ Screen Enjoy
    1 point
  9. Edit: Because of the great response to this topic I wrote a guest blogpost: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/ One of the hidden treasures of processwire seems to be the creation of custom admin pages. Technically speaking those pages are ProcessModules - but i guess that's the reason why so many people out there seem to be afraid of building them... it sounds so hard! You've never created a module for ProcessWire? You have never created a plugin for any other CMS? You have no clue about OOP with all its classes, methods and properties? No problem! I'll show you how simple you can start: <?php class CustomAdminPage extends Process { public static function getModuleinfo() { return [ 'title' => 'Custom Admin Page Example', 'summary' => 'Minimalistic ProcessModule to show that nobody has to be afraid of building custom admin pages.', 'href' => 'https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/', 'author' => 'Bernhard Baumrock, baumrock.com', 'version' => 1, // page that you want created to execute this module 'page' => [ 'name' => 'customadmin', // your page will be online at /youradmin/setup/customadmin/ 'parent' => 'setup', 'title' => 'Custom Admin Page Example' ], ]; } public function ___execute() { return 'This is the most simple Admin-Page you have ever seen :)'; } } Now save this file as CustomAdminPage.module and place it in your /site/modules folder. After a refresh it will show your module in the modules manager of your site where you can install it: After installation you already have your first very own admin page! Congratulations! Was not too hard, was it? It's as simple as that! Now lets add some more custom HTML. And to show you another nice feature we will add this code to a separate method called executeDemo(). And because everything is so simple we will also add some javascript to this page public function ___executeDemo() { $out = ''; $out .= '<h1>H1 has some special css styling in the admin, thats why it seems to have no effect</h1>'; $out .= '<h2>H2 looks different ;)</h2>'; $out .= '<h3>...and so does H3</h3>'; $out .= '<button onclick="myFunction()">Click me</button>'; $out .= '<script>function myFunction() { alert("this is a demo javascript"); }</script>'; return $out; return ''; } Now thanks to ProcessWire-magic your page will already have its own URL: Just append /demo to your url and see what you get: And of course don't forget to click the button Ok, now that code looks a bit hacky, right? Inputfields and especially InputfieldMarkup for the win! We add another method with some advanced code. To use inputfields we need a form that holds all those inputfields and that makes it possible to handle user input lateron. See somas great tutorial about forms here for a quickstart and more details: public function ___executeAdvanced() { $out = '<h2>A more complex Example</h2>'; $form = wire()->modules->get('InputfieldForm'); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Markup Test 1'; $field->value = '<h1>h1</h1><h2>h2</h2><h3>h3</h3><h4>h4</h4>'; $form->add($field); $out .= $form->render(); return $out; } Ok, it get's boring Let's do something more fun and add a chart in a second field and change the fields to 50% screen width (I'm sure you know that already from the GUI template editor)! public function ___executeAdvanced() { $out = '<h2>A more complex Example</h2>'; $form = wire()->modules->get('InputfieldForm'); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Markup Test 1'; $field->value = '<h1>h1</h1><h2>h2</h2><h3>h3</h3><h4>h4</h4>'; $field->columnWidth = 50; $form->add($field); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Chart Sample'; $field->value = '$chart'; //$field->notes = 'Example code taken from here: http://www.chartjs.org/docs/latest/getting-started/usage.html'; $field->columnWidth = 50; $form->add($field); $out .= $form->render(); return $out; } OK, we are almost there... we only need to add the chart library! To keep everything clean we will put the code for the chart in another method. We will make that method PRIVATE to add some security. Our new Method: private function renderChart() { // prepare chart code wire()->config->scripts->add('https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.min.js'); ob_start(); ?> <canvas id="myChart"></canvas> <script> var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { type: 'bar', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth: 1 }] }, options: { scales: { yAxes: [{ ticks: { beginAtZero:true } }] } } }); </script> <?php return ob_get_clean(); } Now we just need to call $this->renderChart() in the right place! Here is the complete Module: <?php class CustomAdminPage extends Process { public static function getModuleinfo() { return [ 'title' => 'Custom Admin Page Example', 'summary' => 'Minimalistic ProcessModule to show that nobody has to be afraid of building custom admin pages.', 'href' => 'https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/', 'author' => 'Bernhard Baumrock, baumrock.com', 'version' => 1, // page that you want created to execute this module 'page' => [ 'name' => 'customadmin', // your page will be online at /youradmin/setup/customadmin/ 'parent' => 'setup', 'title' => 'Custom Admin Page Example' ], ]; } public function ___execute() { return 'This is the most simple Admin-Page you have ever seen :)'; } public function ___executeDemo() { $out = ''; $out .= '<h1>H1 has some special css styling in the admin, thats why it seems to have no effect</h1>'; $out .= '<h2>H2 looks different ;)</h2>'; $out .= '<h3>...and so does H3</h3>'; $out .= '<button onclick="myFunction()">Click me</button>'; $out .= '<script>function myFunction() { alert("this is a demo javascript"); }</script>'; return $out; return ''; } public function ___executeAdvanced() { $out = '<h2>A more complex Example</h2>'; $form = wire()->modules->get('InputfieldForm'); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Markup Test 1'; $field->value = '<h1>h1</h1><h2>h2</h2><h3>h3</h3><h4>h4</h4>'; $field->columnWidth = 50; $form->add($field); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Chart Sample'; $field->value = $this->renderChart(); $field->notes = 'Example code taken from here: http://www.chartjs.org/docs/latest/getting-started/usage.html'; $field->columnWidth = 50; $form->add($field); $out .= $form->render(); return $out; } private function renderChart() { // prepare chart code wire()->config->scripts->add('https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.min.js'); ob_start(); ?> <canvas id="myChart"></canvas> <script> var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { type: 'bar', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth: 1 }] }, options: { scales: { yAxes: [{ ticks: { beginAtZero:true } }] } } }); </script> <?php return ob_get_clean(); } } I hope you enjoyed reading this and it will open up many new possibilities for you! Updates: permissions: https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/?do=findComment&comment=174746 tutorial on file uploads: https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/?do=findComment&comment=185261 snippet how to use NavJSON: https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/?do=findComment&comment=216412
    1 point
  10. This module allows users to subscribe and unsubscribe to a newsletter, it doesn't handle newsletter creation and delivery (I use a foreign service for this). There is one method to subscribe (by using a form) and there are two methods to unsubscribe (by using a form or by providing a link in the newsletter). Furthermore you can notify any person e.g. an administator via email when an user has subscribed/unsubscribed. For detailed information have a look at Github.
    1 point
  11. A client of mine was asking for a solution to send newsletter mails to a list of subscribers. I looked around for a module, but couldn't find any. Then I saw a screenshot on this blog post about UIKit update, and decided to recreate it. Huge thanks to @ryan for the inspiration. The module uses regular pages for building HTML content. These pages can be used to create a fallback link in emails (i.e. "Use this link if you can't view email properly"). During render it injects $page->mailerMode, which can be used to change page output between text and HTML, or to show a simplified, email only HTML output. Screenshots: Main screen is just a list of items. Create page: Module configuration page: During installation, module creates a page under admin for storing items similar to FieldtypeRepeater. It also creates some fields for storing mail info Todo: More testing Sending in batches (with a script that runs in background and real-time progress log) Plans: Integration with Mailchimp (for subscriber lists) Automation (as a separate module for creating email content pages) I'm hoping to complete and release the module in the following days. I think these features should be enough for the beginning, but I'm open to suggestions.
    1 point
  12. https://github.com/thuijzer/processwire-FieldtypeBusinessHours Fieldtype Business Hours ProcessWire Fieldtype for entering business hours (opening hours) Input format Leave a day empty when closed on that day Times are in 24 hour format. 9:00-12:00 9:00-12:00, 13:00-17:30 16:00-2:00 Usage in templates Days are from 1 to 7 where 1 is Monday and 7 is Sunday (ISO-8601) echo $page->field_name->isNowOpen() ? 'Now open' : 'Now closed'; if($page->field_name[1] == null) { echo 'Closed on Monday'; } if($page->field_name[2]->inRange('11:00')) { echo 'Tuesday at 11:00 open'; } echo $page->field_name[1]; echo $page->field_name[1]->getEntries()->getFrom()->format('H:i');
    1 point
  13. The documentation could be clearer in this regard, and I'm probably oversimplifying here, but there two basic categories of selector usage in PW. 1. Methods that use the PageFinder class - common ones would be $pages->find($selector), $pages->get($selector), $page->children($selector). Also find/get selectors for $users. Those are the ones that spring to mind, although there might be a few more. These methods do a database query behind the scenes. 2. All other methods that accept a selector, for example $some_pagearray->find(), which is actually WireArray::find(). These methods do not query the database but work on items that are in memory. There are differences in the ways that these two categories of selector usage are implemented. Some things work in a PageFinder selector that don't work in an in-memory selector. The documentation for Selectors seems to be assuming the reader is interested in PageFinder selectors because there are code examples there that won't work with in-memory selectors. There isn't any definitive list of the differences (that I know of), but here are some things that I have found do not work with in-memory selectors (but do work with PageFinder selectors): 1. Datetime values as strings, e.g. "some_datetime_field>today" 2. Page statuses as strings, e.g. "status!=hidden" 3. OR groups In a perfect world selectors would work the same everywhere and you wouldn't have to think about it. There's an open request for this here.
    1 point
  14. See here for how you can add those settings via hooks:
    1 point
  15. @szabesz and @godmok Ok, new version supports custom labels and input widths on a per field basis. The subfield labels are now also translatable: So in this example, the Spanish rendering looks like this: Please let me know if you have any issues/suggestions. Note for @mel47 - there is currently an issue with the multi-language subfield labels in FormBuilder. Waiting on Ryan here: https://processwire.com/talk/topic/18347-subfield-uselanguages-not-getting-re-populated/
    1 point
  16. That sounds like a great idea. I will think about a way to enter dates that override opening hours.
    1 point
  17. Hello @thuijzer, I dont know if others agree with me, but I would find it useful if an extra input field for public holidays will be added after Sunday. Fe in the gastronomy there is often the scenario that the business is open on public holidays. Here in Austria most of the time restaurants are closed on Monday, but if it falls on a public holiday they are open. So an extra field will take care of this. If the field will be left blank business is closed on a public holiday. Best regards
    1 point
  18. Not sure about SQL schemas, but you should take a look at these options: https://github.com/adrianbj/ProcessMigrator/blob/master/README.md https://processwire.com/blog/posts/processwire-3.0.68-and-more-on-page-export-import/ Importing and exporting fields and templates has been in core for a while now. The format which is used is JSON. You could just as well write JSON yourself for automatic creation. The import feature is labelled "beta" though - perhaps test it out on a dev system first and see how it goes.
    1 point
  19. Try hooking InputfieldImage instead of FieldtypeImage.
    1 point
  20. @Juergen In PW 3.0.87 there were some updates to field/template context settings and now you can change field settings in the context of other templates through admin UI. https://processwire.com/blog/posts/pw-3.0.87/ Maybe this update has changed something in core that prevents your hook to work.
    1 point
  21. Nice module, thanks for sharing. I wonder though how effective it really is reading the last two sections "caveat emptor" and "blackhole whitelist": https://perishablepress.com/blackhole-bad-bots/#blackhole-whitelist
    1 point
  22. Beautifully designed sites! Colour schemes, fonts and white space are gorgeous. I see the social links too, thanks. Great work
    1 point
  23. And append ->unique() to remove duplicates.
    1 point
  24. You could filter the PageArray more than once and add the results together. Actually, filter() is destructive so use find() instead. $results = $pagearray->find($selector_1)->add($pagearray->find($selector_2));
    1 point
  25. Yes, OR-groups unfortunately only work for database searches, not in-memory operations on PageArrays.
    1 point
  26. @oma: Like @kongondo, I'm not completely sure if I'm getting your question right. Are you, perchance, looking for or groups, i.e. a way to tell the filter "return all events that fulfill the other criteria and are either today or next month"? In that case, you need to still use commas but surround the individual selector parts that are sufficient for a successful match with parenthesis. $events = $pages->find( // Basic selector for all events not yet ended "template=events-detail, events_detail_dates_final_date>=$today" // First OR-group, today's events . ", (events_detail_dates_upcoming_start_date<=$now)" // Second OR-group, events next month . ", (events_detail_dates_next_month_start_date<=1519844959, events_detail_dates_next_month_end_date>=1517512159)" ); This would get all events-detail pages not yet ended and - sticking to your example and using parenthesis to outline PW's syntax - either (running through today) or (running next month).
    1 point
  27. Take a look at the screenshot in this post:
    1 point
  28. Thanks for your help! No cPanel, a custom made tool. I had installed Tracy Debugger, but couldn't see anything wrong. Maybe I will check the ProDevTools. On monday I will see t get in touch with someone else. Unfortunately there is no monitoring but I do have rights to install software. Had New Relic on my mind, but you link looks like a quite nice list. I am not that familiar with installing apps on the terminal, but I can clone the server and "test ruin" everything No, there is nothing new the last 30 days. It is a rather small business website. Just usual pages like "About", "Team" etc. There is almost nothing special in there. I will check on MySQL! Currently the site works fine. But I increased memory to 4 GB. I find it hard to believe I am using 4 GB for a tiny website
    1 point
  29. The author may be using a previous mysql version that did not have this option enabled by default. I was just curious because I couldn't see a instructional site/book giving you wrong information. And it doesn't matter at all whether you know what group by does. The point is that you are wanting to learn everything you can. We all can learn something new regardless of experience.
    1 point
  30. "Sounds" useful Thanks for sharing and caring!
    1 point
  31. [offtopic] you know that tracy has the bd() option to dump beautifully highlighted and collapsible variable dumps? Do you still have a question? I cannot really follow your --edit-- junks
    1 point
  32. Just pushed a little update that makes the definition of recipes easier, see this sample: <?php $password = $this->randomPassword(); return [ 'pw' =>'https://github.com/processwire/processwire/archive/dev.zip', 'profile' => 'site-default', 'settings' => [ 'timezone' => 368, // vienna 'dbName' => 'yourdbname', 'dbUser' => 'root', 'dbPass' => $this->randomPassword(), 'admin_name' => 'youradminurl', 'username' => 'youradminusername', 'userpass' => $password, 'userpass_confirm' => $password, //'dbTablesAction' => 'remove', // overwrite existing tables? ], 'recipes' => [ function() { $this->msg('Installing RockMockup...'); $this->installModule('RockMockup', 'https://gitlab.com/baumrock/RockMockup/repository/master/archive.zip'); $this->succ('RockMockup installation completed'); }, ], ]; I also added this video to the first post to demonstrate how easy it is to use (I think all the screenshots may have made the impression that it is complicated)!
    1 point
  33. Good to hear you and your family are doing fine Ryan. As always nice solution for a problem which seems to resolved by fixed crops, but this is a way better UX for the content editors.
    1 point
  34. Ryan, The better : Thanks to God who gave you some holydays, with your childs and wife. Friendly from France Euskadi Kasu64
    1 point
  35. Can't wait to try out the new focus feature! One question, I haven't tried it, just seen the vid (on the phone now). Does this replace the 'cropping' => 'southeast' from the $options array? What happens if you crop "ne" at 400 x 200 (from an image 1000 x 800) for example then use the focus tool in the page editor? This new feature looks like I can throw all my pre-empting out the window, leave crop at centre, just set the size and use focus. Which would be awesome.
    1 point
  36. Whilst you’ve got cold temps and snow, we’re in the last stretch of what’s been a week-long heatwave here in SA’s highveld. Upwards of 30°C (estimated, real-feels were up to 37°C) since Monday. Next week shall cool down considerably, apparently, and very much hopefully.
    1 point
  37. @ryan Call your insurance agent to file a claim. Wind driven rain is covered under base policies. Make sure you photograph everything for the adjuster. Even if the initial claim doesn't cover your deductible, you can file a subsequent claim (same policy/claim number) to cover any future damage (highly likely) without incurring another deductible.
    1 point
  38. Hey fellow forum members: everyone in the Atlanta region go help Ryan shoveling snow! Everyone else - visit The Store and buy a Pro moule for the disaster relief fund!
    1 point
  39. Hello @abdus, congrats on your really great venture. Much appreciated. Is there any news about your newsletter module?
    1 point
  40. Hi @abdus, Do you know if it's possible to use this technique to add config fields such as minWidth and maxWidth to the template context for InputfieldImage? My first attempt isn't working: // Add more image config fields to template context $this->addHookMethod('InputfieldImage::getConfigAllowContext', function (HookEvent $e) { $allowables = ['minWidth', 'minHeight', 'maxWidth', 'maxHeight']; $e->return = array_merge($e->return, $allowables); }); I have a feeling that the reason this doesn't work is because those config fields are inside a fieldset. Adding the whole fieldset would be fine, but the problem is that the fieldset doesn't have a name to add to getConfigAllowContext(). Any ideas? ----- EDIT: have sussed it out. I used another hook to give names to those fieldsets. // Give names to image config fieldsets $wire->addHookAfter('InputfieldImage::getConfigInputfields', function(HookEvent $event) { /* @var InputfieldWrapper $wrapper */ $wrapper = $event->return; $f = $wrapper->getChildByName('maxWidth'); $fieldset = $f->parent; $fieldset->name = 'maxDimensions'; $f = $wrapper->getChildByName('minWidth'); $fieldset = $f->parent; $fieldset->name = 'minDimensions'; }); // Add more image config fields to template context $this->addHookMethod('InputfieldImage::getConfigAllowContext', function (HookEvent $e) { $allowables = ['maxDimensions', 'minDimensions']; $e->return = array_merge($e->return, $allowables); });
    1 point
  41. I've added Mailchimp support A few more screenshots: Subscription Lists - Services New Subscription List - Mailchimp Module Configuration - Service Selection
    1 point
  42. That function is now deprecated. You can create a Textformatter module if you want to, eg.:
    1 point
  43. Time ago I needed something similar. I solved it with a small script. You may use it as a starting point: $media = wire('pages')->find('parent=1034,template=medium,include=all'); $media->sort('media_type,status,title'); foreach ($media->getValues() as $key => $medium) { $medium->of(false); $medium->sort = $key; $medium->save(); // var_dump($key.' - '.$medium->sort.' - '.$medium->media_type.' - '.$medium->title); }
    1 point
×
×
  • Create New...