Leaderboard


Popular Content

Showing most liked content since 03/23/2018 in all areas

  1. 20 points
    With everything running smoothly on the new master version, we wanted to recommend a few additional steps that will help you take advantage of some of the new features. Plus a look at developing for and with ProcessWire. https://processwire.com/blog/posts/what-to-do-after-upgrading-to-the-latest-master/
  2. 19 points
    For the most part I've been working to wrap up a client project this week, running in ProcessWire of course. At this point I'm using markup regions exclusively on new projects, as they really add an element of fun while also simplifying development, at least in my case. Admittedly, when we first introduced markup regions, I thought they'd be a good alternative for new users (who might otherwise use direct output), and didn't think I'd be using them myself. I was wrong. After I started using them, quite awhile ago, I've found that I rarely want to use anything else. I enjoy using them, whether developing something new, or going back and modifying an existing site that's using markup regions. I'm curious if other people have also taking a liking to them? There have been some commits to the core this week, as well as some other not-yet-committed updates on the dev branch, but not enough to warrant a version bump today. So we'll save the 3.0.99 version for next week. I have been getting lots of good reports on the current PW master version, very few issue reports, and feel we've got a really good solid and stable version on our master branch right now. Just in case there's anyone that's not yet using it, I recommend the upgrade. Thanks for reading, hope you all have a great weekend.
  3. 17 points
    This module evolved from the RockDataTables discussion thread: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables; Special thanks to @adrian for the idea and @theo for his contributions. Several performance tests showed that it is absolutely necessary for grids with several thousand of rows to use SQL queries instead of $pages->find() operations. ALPHA, I'm currently working on it and the syntax will likely change a little bit Download: https://gitlab.com/baumrock/RockFinder Usage: Please see instructions in this post: I open a separate thread for this module because the initial discussion thread is quite bloated already and here I can share informations only related to this module. Also maybe some of you might not even know about it yet. Requires PW >= 3.0.46 because it utilizes the $pages->findIDs() method: https://processwire.com/api/ref/pages/find-i-ds/ Changelog: https://gitlab.com/baumrock/RockSqlFinder/commits/master
  4. 17 points
    Hello, friends! These days it is not that easy to join you here on the forums if you happen to be anywhere in Russia. You probably heard about our government's struggle to ban Telegram. And ProcessWire's ip is in the list. At these moments you start to understand just how important can a seemingly remote online community be in your everyday life and work. Thank you all for being here. As long as VPN's still function we can stay together .
  5. 16 points
    As threatened in the Pub sub forum in the "What are you currently building?" thread, I've toyed around with Collabora CODE and built file editing capabilities for office documents (Libre-/OpenOffice formats and MS Office as well as a few really old file types) into a PW module. If you are running OwnCloud or NextCloud, you'll perhaps be familiar with the Collabora app for this purpose. LoolEditor Edit office files directly in ProcessWire Edit your docx, odt, pptx, xlsx or whatever office files you have stored in your file fields directly from ProcessWire's page editor. Upload, click the edit icon, make your changes and save. Can be enabled per field, even in template context. Currently supports opening and saving of office documents. Locking functionality is in development. See the README on GitHub for installation instructions. You should be reasonably experienced with configuring HTTPS and running docker images to get things set up quickly. Pull requests are welcome! Here is a short demonstration:
  6. 16 points
    A short update this week looking at ProcessWire 3.0.97 and a preview of coming attractions: https://processwire.com/blog/posts/processwire-3.0.97-core-updates/
  7. 15 points
    Hey guys. Fresh off the oven. We're still polishing a bit, but went live anyway: https://inovtex.com/ Sorry this one is in Portuguese only, so you'll probably need the old google translate for it.
  8. 14 points
    An Images field allows you to: Rename images by clicking the filename in the edit panel or in list view. Replace images, keeping metadata and filename (when possible) by dropping a new image on the thumbnail in the edit panel. Introduced here. But neither of these things is possible in File fields, which prompted this module. The way that files are renamed or replaced in this module is not as slick as in the Images field but it gets the job done. The most time-consuming part was dealing with the UI differences of the core admin themes. @tpr, gives me even more respect for the work that must go into AdminOnSteroids. Most of the code to support the rename/replace features is already present in InputfieldFile - there is just no UI for it currently. So hopefully that means these features will be offered in the core soon and this module can become obsolete. Files Rename Replace Allows files to be renamed or replaced in Page Edit. Usage Install the Files Rename Replace module. If you want to limit the module to certain roles only, select the roles in the module config. If no roles are selected then any role may rename/replace files. In Page Edit, click "Rename/Replace" for a file... Rename Use the text input to edit the existing name (excluding file extension). Replace Use the "Replace with" select to choose a replacement file from the same field. On page save the file will be replaced with the file you selected. Metadata (description, tags) will be retained, and the filename also if the file extensions are the same. Tip: newly uploaded files will appear in the "Replace with" select after the page has been saved. https://github.com/Toutouwai/FilesRenameReplace http://modules.processwire.com/modules/files-rename-replace/
  9. 13 points
    Hi, just wanted to share something I came across while working on an import module for XML data from a web service. The XML I got was not huge, but still, loading around 3.5 MB of XML with 250+ large child nodes into memory at once with simplexml_load_file() and then looping over it had significant impact on performance. I searched for a solution and found this great article about how to parse large XML files. It basically explains how to utilize the native XMLReader class together with SimpleXMLElement to handle such situations in a memory efficient way. After implementing it I got a significant improval on perceived performance. No comparison in numbers to share here as I'm a bit short on time.
  10. 13 points
    I've been searching for a CSS-only solution for a while to reveal a scroll-to-top link only after scrolling down the page, but no luck. Today I figured out that it's possible with position: sticky. The beauty of this is that you don't need to check the scroll position in a scroll event (+ in document ready, window resize), which makes it really lightweight. Update: added "html { scroll-behavior: smooth; }" and now there's animated scroll (Firefox 58+, Chrome 63+). It seems that Js is not required anymore to this feature. CodePen demo
  11. 13 points
    So I decided to wade into module development and created a wrapper module around ImageOptim, a service that compresses and optimizes images in the cloud. ImageOptim currently handles JPG, PNG and GIF files and, depending on the settings you use, shaves off between 15% and 60% in filesize. Great for bandwidth and great for users, especially on mobile. This module handles the part of uploading images to ImageOptim via their official API, downloading the optimized version and storing it alongside the original image. Download & Info GitHub / Module directory / Readme / Usage Why ImageOptim? There are other image optimization services out there, some of them free, that have outstanding ProcessWire modules. A few things make ImageOptim the best tool for most of my customers: It's not free, i.e. it will probably be around for a while and offers support. However, it's cheaper than some of the bigger competitors like Cloudinary. And it does PNG compression better than any of the free services out there, especially those with alpha channels. Installation Install the module like any other ProcessWire module, by either copying the folder into your modules folder or installing it via the admin. See above for downloads links on GitHub and in the module directory. Requirements To be able to upload images to the service, allow_url_fopen must be set on the server. The module will abort installation if that's not the case. I have only tested the module on ProcessWire 3.x installations. I don't see why it shouldn't work in 2.x, if anyone wants to try it out and report back. ImageOptim account To compress images, you first need to sign up for an ImageOptim account. They offer free trials to try the service. Usage (manual optimization) Images can be optimized by calling the optimize() method on any image. You can pass an options array to set ImageOptim API parameters. $image->size(800,600)->optimize()->url $image->optimize(['quality' => 'low', 'dpr' => 2]) // Set quality to low and enable hi-dpi mode Automatic optimization The module also has an automatic mode that optimizes all image variations after resizing. This is the recommended way to use this module since it leaves the original image uncompressed, but optimizes all derivative images. $image->size(800,600)->url // nothing to do here; image is optimized automatically To change compression setting for single images, you can pass an options array along with the standard ImageResizer options. Passing false disables optimization. $image->size(800, 600, ['optimize' => 'medium']) $image->size(800, 600, ['optimize' => ['quality' => 'low', 'dpr' => 2]]) $image->size(800, 600, ['optimize' => false]) For detailed usage instructions and all API parameters, see the usage instructions on GitHub. Filenames Optimized images will be suffixed, e.g. image.jpg becomes image.optim.jpg. You can configure the suffix in the module settings. Roadmap Asynchronous processing. Not really high on the list. Image variations need to be created anyway, so waiting a few seconds longer on first load is preferable to adding complexity to achieve async optimization. Optimize image variations created by other modules. CroppableImage comes to mind. I don't use any of these, so if somebody wants to help out and submit a pull request — all for it! Add a dedicated page in the setup menu with a dashboard and detailed statistics. ImageOptim's API is very barebones for now, so not sure if that's feasible or even necessary. Stability I've been using this module on production sites for some time now, without hiccups. If you do notice oddities, feel free to comment here or investigate and submit PRs.
  12. 13 points
    Hello All, I started with Joomla on this CMS parade. Then later I put my hands on Wordpress and eventually settled into Concrete 5. Recently I came to know about ProcessWire CMS, while I was looking for a better replacement for Concrete 5 in terms of robust, easiness, compact. I went through few Video tutorials of PW and read the documentation. The installation of PW was smoothy. The concept of Page is awsome. I like the relation of Page, Fields & Templates. There are many things I can equal to Concrete 5 from ProcessWire, yet PW offers a tiny minimal, code level approach for CMS. We have full control over design & data. There are some pitfalls I felt such no sitewide settings, global logo setup etc but it is easily tackled with some API codes. PW api seems amazing, it is par with what Concrete 5 Offers. I have done a simple website in ProcessWire now and going to do a lot further : http://insignnia.in/
  13. 12 points
    In this post we look at a new core version on the master branch, and a new version of ProCache that includes a browser-cache busting feature called Buster: https://processwire.com/blog/posts/pw-3.0.98-procache-buster/
  14. 11 points
    General This is a lightweight alternative to other newsletter & newsletter-subscription modules. It can update / create a subscriber in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin. This module fits your needs if you... ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe users to different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns You can find it here: https://github.com/danielstieber/SubscribeToMailchimp Let me know what you think and if I should add it to the Modules Directory. Setup Log into your Mailchimp account and go to Profile > Extras > API Keys. If you don't have an API Key, create a new one. Copy your API Key and paste it in the module settings (Processwire > Modules > Site > SubscribeToMailchimp). Back in Mailchimp, go to the list, where you want your new subscribers. Go to Settings > List name and defaults. Copy the List ID an paste it in to the module settings. Usage To use the module, you need to load it into your template: $mc = $modules->get("SubscribeToMailchimp"); Now you can pass an email address to the module and it will try to edit (if the user exists) or create a new subscriber in your list. $mc->subscribe('john.doe@example.com'); You can also pass a data array, to add additional info. $mc->subscribe('john.doe@example.com', ['FNAME' => 'John', 'LNAME' => 'Doe']); You can even choose an alternative list, if you don't want this subscriber in your default list. $mc->subscribe('john.doe@example.com', ['FNAME' => 'John', 'LNAME' => 'Doe'], 'abcdef1356'); // Subscribe to List ID abcdef1356 Important Notes This module does not do any data validation. Use a sever-sided validation like Valitron Make sure that you have set up your fields in your Mailchimp list. You can do it at Settings > List fields and *|MERGE|* tags Example Example usage after a form is submitted on your page: // ... validation of form data $mc = $modules->get("SubscribeToMailchimp"); $email = $input->post->email; $subscriber = [ 'FNAME' => $input->post->firstname, 'LNAME' => $input->post->lastname, ]; $mc->subscribe($email, $subscriber); Troubleshooting In case of trouble check your ProcessWire warning logs. I can't see the subscriber in the list If you have enabled double opt-in (it is enabled by default) you will not see the subscriber, until he confirmed the subscription in the email sent by Mailchimp I get an error in my ProccessWire warning logs Check if you have the right List ID and API Key. Check if you pass fields, that exist in your list. Check if you pass a valid email address. Go to Mailchimps Error Glossary for more Information How To Install Download the zip file at Github or clone directly the repo into your site/modules If you downloaded the zip file, extract it in your sites/modules directory. You might have to change the folders name to 'SubscribeToMailchimp'. Goto the modules admin page, click on refresh and install it
  15. 11 points
    This week's version of ProcessWire on the dev branch includes some useful updates to the included AdminThemeUikit module. It also adds a new config setting for disabling HTTPS requirements in dev/staging environments, as well as some other updates: https://processwire.com/blog/posts/pw-3.0.99/
  16. 11 points
    1. This part... // 4. // Split search phrase // If nothing above matches, try each word separatly if( !count($matches) ) { $q_separate = preg_replace('/\PL/u', ' ', $q); // "Remove" everything but letters $q_separate = preg_split('/\s+/', $q_separate); foreach ($q_separate as $q_word) { if ( $q_word != '' && strlen($q_word) > 4 ) { $append_products_separate = $pages->find("title|headline|summary~=$q_word, template=product, limit=50"); $matches->append($append_products_separate); } } } ...is needlessly inefficient. You don't need to do separate database queries per word here - you can use the pipe as an OR condition between words. So basically replace spaces with pipes in your search phrase and match against title|headline|summary. 2. Consider using the %= operator so you can match part words. So a search for "toast" will match "toaster". 3. If you don't have a huge number of products then maybe a fuzzy search using Levenshtein distance could be a possibility, for product title at least. I did a quick test against 196 country names (239 words) and it was reasonably fast. $q = 'jermany'; $countries = $pages->find("template=country"); $matches = new PageArray(); foreach($countries as $country) { $words = explode(' ', strtolower($country->title)); foreach($words as $word) { // Adjust max Levenshtein distance depending on how fuzzy you want the search if(levenshtein($q, strtolower($word)) < 2) { $matches->add($country); break; } } }
  17. 11 points
    I just relaunched my portfolio website. It's my first ajax driven website using ProcessWire as a CMS. Its a showcase of some of my work as well as a digital playground to improve my coding skills. If you encounter any bugs or have feedback, feel free to share janploch.de
  18. 10 points
    Rebuilt my own site recently using all the knowledge, tips & tricks I've learnt from the PW docs, forums etc, including adding PWA features. Ran it through several publicly available audits and it passed OK - w3c validation, google page speed insights, google lighthouse, etc. Also engaged a digital marketing agency to audit it from a Google search POV. Still some tweaking to do on content & backlink fronts. Overall though happy with the result which could never have been achieved without the help and support of the ProcessWire community. Thank each and everyone of you. https://www.clipmagic.com.au
  19. 10 points
    I did a develop and made dis, a procedural galaxy that, well... gets procedurally generated. You can use your mouse to zoom in/out and look around. You can click on stars to get their specific information. It's inspired by the galaxy maps found in games like Elite Dangerous and Eve Online. http://fransvanberendonk.com/procedural-galaxy/ Basicly I've made Templates and Fields for Spectral Classes and Subclasses, and looked up online what a realistic distribution scheme would be for these. This data is grouped under a page that renders then as JSON for the Javascript application to work with. I wrote that app in AngularJS, so I could add more controllers to it later. It also uses BabylonJS to calculate the number and position of stars and display them on screen, and assigns each a Spectral Class and Subclass after some shuffling of the dataset. Using a secondary controller only used in a ProcessModule for the CMS, I can broadcast events that redo the procedure using different variables (see screenshot below). No particular purpose, just thought I'd share a cool side project that rolled out of my exploration of these JS frameworks in conjunction with PW.
  20. 10 points
    Adds a class="external" and a rel="nofollow" to every external link by default. Optionally adds a rel="noopener", a rel="noreferrer" and a target="_blank". Note: This module is based on TextformatterMarkExternalLinks and some improvements of @teppo that were never implemented due to module's author inactivity. Download TextformatterOptimizeExternalLinks Requirements ProcessWire 3.x Changelog 1.0.0 (3 April 2018) Initial release
  21. 10 points
    Hello I've been looking for a way to give "editors" a little bit more freedom regarding the layout, without having to care about CSS, Fields, Templates etc. After playing with PageTable(-Extended) and Bootstrap, this is the (intermediate) result: http://theowp.bplaced.net/upload/prev.html It is just a proof of concept atm. Does anything like this already exist for PW?
  22. 10 points
    Or you can steal one or two methods @ryan's code, stuff them into your little module, tweak a few lines and add even more fun to PW Attached is a quick & dirty little module (actually, two of them) that adds: $log->mailLog($your, $fields, $ending, $with, ..., $messagebody) [pass as many arguments as you like; the last one will always have white-space set to wrap] a special log viewer at Setup -> Mail Log that displays as many columns as you sent to mailLog() It uses some unlikely to naturally occur text patterns for newlines and field separators and fools ProcessLogger::executeView into thinking it is pointed to the mail log, and that way lets it do the heavy lifting. ProcessMailLogger.zip
  23. 10 points
    @maxf5, I have just removed certain remark from your earlier post as a moderation action. Also my apologies to @cmscritic – you definitely shouldn't have to see that kind of language here. A friendly reminder from the moderating team: please keep the tone of discussion polite. Crude or discriminative remarks and insults of any kind will absolutely not be tolerated on this forum. As a community we're committed to keeping this forum a safe and welcoming place for everyone. Think before you post.
  24. 9 points
    Hi, based on the work of @microcipcip and @gebeer (see their posts here and here), I put together a React + Processwire boilerplate (profile). Here is the Github repository: https://github.com/lapico/process-react Cheers, K
  25. 9 points
    Each year we cycle 1000km with our company to fight against cancer. To participate with 4 teams we have to collect 20.000 euros. Our graphic designers made some goodies en we also organise a spaghetti fundraiser. To help the sales we decided to make a webshop with our webteam. And of course we used our favourite CMS for the job! 🙂 https://shop.typografics.be/ At this moment we raised more than 20.000 euros, so all our teams can participate. This is a very special project for us, unfortunately one of our colleagues has been diagnosed with cancer and currently is fighting against this terrible disease. Premium PW modules used in this project: PadLoper FormBuilder ProFields Variations With a few hooks here and there we managed to make it work. To handle the payments we made use of Mollie, we created our own payment module and will opensource this soon. You can read more about this project in our blog (in dutch) Unfortunately we're currently only shipping to Belgium We’re already brainstorming to make a 2.0 version of this webshop, so all your feedback is more than welcome.
  26. 9 points
    I had the same thought initially when Markup Regions were introduced, but after thinking about it some more I don't know that this amounts a good reason not to use something. Because you could actually say the same thing about most aspects of the PW API and therefore never start with PW in the first place. Take $files->render() for example. If you're coming in cold knowing nothing about PW you're not going to instantly understand how this works, what variables will be in scope, etc. You have to take a bit of time to become familiar with the method, read the documentation, test things out. So really no different to Markup Regions. Once you read the introduction and try out Markup Regions it starts to make sense very quickly. Personally, I think Markup Regions are a fantastic feature and I have used them on every new site since they were introduced.
  27. 9 points
    It was a server issue and not a ProcessWire one - the reason behind the message "This request was aborted because it appears to be forged" on this case was because the PHP session path was not writable. The website is back online with backend working like a charm 😶
  28. 9 points
    JavaScript, CSS and $this->wire('files')->render('your-file') in Runtime Markup code setting . 'your'file' has the PHP. See video demo below. Works on the fly, no need to save first + shows what's already saved. I do . See video demo. Another option is RM as suggested by @Sergio. See this quick demo. I can post the code later in RM's forum. Picture Options is a Select Options field. Options Illustration is a RuntimeMarkup Field.
  29. 9 points
    Thanks so much for continuing to develop this awesome tool! Happy to report I just bought my first Pro module this week (ProFields) and it's really streamlining my workflow. You are the rare developer who understands the essence of why people adore the product (your frequent use of the words "fun" and "love" regarding PW is apt) and just continue to make it better. Curious about the non-profit data research project you mentioned in the blog post? I am using PW to interact with the REDCap API for a large public mental health research project. I was initially asked to do it this project in R (which I use for data analysis in my dayjob). As discussions continued, I realized what they actually needed was a highly configurable web interface with a few data score norming and graphing features...PW to the rescue, and it's inspired me to make my first module (REDCapi) and Process Module for the admin interface.
  30. 8 points
    Few random thoughts... Log all searches (you probably already do). This works $log->save('search',"Query = '$q' Results = ($results_count) $pages_found"); gives something like 2018-03-12 16:19:08 guest https://example.com/search/?q=taxi Query = 'taxi' Results = (3) 1170|1073|1693 2018-03-13 11:22:27 guest https://example.com/search/?q=9001 Query = '9001' Results = (1) 1021 This is valuable because it shows you what you are up against! Consider incorporating stemming (if you are working in English, at least). The best-known algo is the Porter stemming algorithm. There are PHP implementations on GitHub etc. What you could look at is for each product, hook on product save and have a back-end field programmatically populated with stemmed versions of Product Title etc., then stem search words and build that into your selectors. Also consider a back-end 'search keywords' type field, and if there's a glaring regular user mis-spelling just add that manually. This doesn't scale all that well, but can help with a quick fix. (I built a search for a fishing tackle shop site many years ago - pre-PW - and nearly as many searchers spelt 'Daiwa' as 'Diawa' as those who got it right. Easy quick fix.)
  31. 8 points
    Adds a soundex.field=something search option (so no custom operator) for database queries (so in your case, you'd use a selector like "soundex.firstname=$firstname, soundex.lastname=$lastname): <?php // Add to site/ready.php wire()->addHookAfter("PageFinder::getQueryUnknownField", function(HookEvent $event) { static $n = 0; $fieldName = $event->arguments(0); $data = $event->arguments(1); // We only handle our soundex queries if($fieldName != "soundex") return; if(empty($data["subfield"])) { throw new PageFinderSyntaxException("soundex selector expects the name of the field to search as subfield, e.g. 'soundex.title=something'"); } $selectors = $data["selectors"]; $selector = $data["selector"]; $query = $data["query"]; if(! $selector instanceof SelectorEqual) { throw new PageFinderSyntaxException("Invalid operator. Only '=' is allowed in soundex selectors"); } $subfield = "data"; $fieldName = $data["subfields"]; if(strpos($fieldName, '.') > 0) list($fieldName, $subfield) = explode('.', $fieldName); else $fieldName = $data["subfield"]; $field = wire('fields')->get($fieldName); if(!$field) { return; // does not resolve to a known field } // Initialize some needed variables $database = wire('database'); $table = $database->escapeTable($field->getTable()); $subfield = $database->escapeCol(wire('sanitizer')->fieldName($subfield)); $n++; $tableAlias = "_subquery_{$n}_$table"; $join = "$table AS $tableAlias ON $tableAlias.pages_id=pages.id"; $where = "$tableAlias.$subfield SOUNDS LIKE " . $database->quote($selector->value); $query = $data["query"]; $query->join($join); $query->where($where); $selectors->remove($selector); $event->return = true; });
  32. 8 points
    Welcome @MikeM! Probably not telling you something you don't already know: the project may be simple conceptually, but it won't be a simple development task. You'll need to work with an experienced developer in order to get a good result with this project. PW is an excellent platform to use for just about any web project, and considering where you are posting this you'll probably find lots of people here who will tell you the same thing. But to be honest, there are many platforms that could be used successfully for this project - in reality the success is more likely to come down to the experience and skill of the developer you hire than the platform used. So seeing as you won't be building the site yourself, your task is really to evaluate developers rather than evaluate ProcessWire. That sounds unusual to me - I haven't heard of people developing one site just to serve as an example for another site they want developed. More typical I think is to use a wireframing tool to show the flow of interactions. This helps you clarify to yourself how the website will work and also helps communicate your intentions to the developer. The wireframe could also demonstrate the design if you wanted that, using a tool such as Invision. Here are some links to a few popular wireframing apps if you want to look at that approach instead: https://www.invisionapp.com/ https://www.mockflow.com/ https://wireframe.cc/
  33. 8 points
    ProcessWire will make you want to be, and then in a fairly short space of time become a developer. I've been using ProcessWire for a year now, and whilst I still haven't published any modules like the very talented people on this forum, I've more than tripled my clients, can take an idea to a working prototype stage in less than a week and honestly enjoy every minute I spend interacting with PW. My previous background was purely as a web designer, bespoke designs but using various modules and essentially piecing sites together as many do. I also started with a personal project to get my head around PW, it was essentially a membership based database where users could add 'titles' to their collection and share them with others, produce stats etc. I never finished it because I moved onto client work but it functions perfectly and was a great, pressure-free basis for learning PW. I did a bit of maintenance this evening on an old clients WordPress site, and it's just a bloated, illogical mess and just being logged in feels like a security risk. The other option you may want to consider is Laravel, which I started learning after picking up ProcessWire, but with having the CMS out of the box (plus a ton of other time saving benefits) means there's no real reason to use Laravel over PW.
  34. 7 points
    Sorry to say, whenever I see the vanilla JS alternatives to jQuery, it reminds me why I still use jQuery
  35. 7 points
    Hi. I'm eager to present you my website, officially released last week. It's multilingual website about a science&techno event (science popularization) which be held in May, in Québec, Canada. Organizers can register their events with Form builder and those events are display on front-end. http://science24heures.com I take the opportunity to thanks everyone who answer my questions, update their module or even create new one! I will not name people, because I will for sure forget some... I still have some issues with the website, but it's a work-in-progress, and I still have a lot of features I want to add for next year. By the meantime, comments and suggestions are welcome (just take in account it's not my job, but I volunteer for this organization for many years and suggested them to rebuild the website which was 12 years old (!)) Thanks again for PW and this community. I learned a lot of new knowledge (forms, hooks, svg more php and css, just naming some) along this journey... Mélanie
  36. 7 points
    Everybody's currently hyping about Collabora CODE and editing OpenOffice, MS Office and PDF documents inside their Own-/NextCloud. Recently, a colleague wanted to know if it was possible to do that in our corporate intranet too. And so I thought, why not? So I have started dabbling with NextCloud and the Collabora docker image a bit and, after banging my head against the wall for a while (figuratively) and doing a lot of reverse engineering to wrap my mind around the wopi and lool stuff, I managed to include the LOOL leaflet in a page of my own making and load and save documents in it through a small PHP script. I'm starting to create a PW module from this that allows inline (more precisely: modal) editing of supported document types. The next steps: A small file abstraction layer that converts back and forth between WOPI-style file ids necessary for LOOL and PW file urls, provides locking and checks access permissions A file access token generator / verifier A WOPI REST endpoint library that handles all the actions needed for opening, saving, locking etc. and provides auxiliary information like user info, avatar etc. Finally, the module itself, containing both the WOPI endpoint logic that the Collabora image uses and the UI extension for InputfieldFile that creates the editor I'm going to get the basics set up, then I'll whip up a getting started manual that also documents the "missing links" that I had so much trouble with and finally push this and the code to github so anybody interested can contribute too.
  37. 7 points
    The reason, after the upgrade of Plesk and PHP, by default the PHP setting session.save_path point to /var/lib/php/session and not /var/tmp where before he got r/w permissions (I don't know if Plesk was already installed or not before the upgrade). The final problem was not MySQL.
  38. 7 points
    I stumbled across this on Github ... just breathtaking .... piece of history right there. A good place to brush up on your Assembly Language https://github.com/chrislgarry/Apollo-11 By the way, Margaret Hamilton who worked on the module is considered a programming genius. https://www.wired.com/2015/10/margaret-hamilton-nasa-apollo/
  39. 7 points
    ModuleManager inherits from the Process class and calls its parent's init method here. Process::init in turn invokes Modules::loadModuleFileAssets. This method looks for .js and .css files in the same location and with the same name as the module it is called for and, if found, adds them to $config->scripts / $config->styles. Admin themes all have lines like these in their template code to load the contents of the $config->scripts and $config->styles: <?php foreach($config->styles as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />"; ?> <?php foreach($config->scripts as $file) echo "\n\t<script type='text/javascript' src='$file'></script>"; ?>
  40. 7 points
    If you're looking to do an elaborate a page builder with ProcessWire and don't want to pull your hair out, I highly recommended viewing this video: A couple notes: with the css grid specification, you can assign multiple blocks to the same grid-area but they will overlap each other. I've "overcome" this by combining multiple blocks into a parent div and assigning that instead. pretty easy to do. i didn't demonstrate it, if your blocks have a grid structure within them (like built with flexbox), you can still assign that block to a grid-area. so if your blocks themselves have a grid structure, that's ok. for example, if your css grid layout is 6 columns, but you have a block that has a grid inside of it (built with like uikit's grid that's 5 columns), you can assign that block to the grid-area. with the css grid specification, the flow of the blocks does not have to match the flow of the grid-areas. this is insanely powerful. Enjoy.
  41. 7 points
    Dear @horst, thanks for the valuable feedback. Indeed you mentioned a very good point. I suspect I had a slightly different than usual understanding of how to remove image variations created by modules. The current implementation uses a glob (/{page folder}/{original file basename}.*) to delete variations. I'll update the module to use the standard naming scheme — this will have its benefits especially in edge cases, e.g. images will then still get removed if the module is uninstalled or deactivated. Also good idea about having a public method removeOptimizedVariations(). That will be very easy to implement with the previous issue.
  42. 7 points
    Welcome to Processwire! I inherited a club website built in Concrete 5, and it was so slow that page loads were taking over 20 seconds. The way the site had been structured wasn't particularly intuitive either. I'm not sure if it was a Concrete 5 issue or poor implementation, but after I converted it to Processwire, I had a dramatic improvement in page load times, and found the page editing was far more intuitive to the point I could hand over day-to-day editing to non-technical users, whereas the previous webmaster, even with several years using the system and some technical knowledge, still ended up making mistakes on Concrete 5. Processwire passed my '1/2 hour test', ie by looking at the documentation for no more than 1/2 an hour, I was able to have enough of an understanding of the system to start customising sites. As a developer, a 2 minute install is nice, but if it then takes hours to understand the structure of the system to start customisation, then it's not great.
  43. 7 points
    Hi @d'Hinnisdaël, many thanks for this well crafted module. I (only) have read the modules code and checked some, (maybe critical) points for image modules . Everything seems to be well done! Only one thing I spotted, needs a bit clarification from you, as I may not see the whole picture yet. You added a new hook delete to Pageimage. I cannot see how this integrates with PW's methods for deleting variations. How gets it invoked when I a) delete an image via UI and b) when I call removeVariations() via the API? Or what is it for, exactly? Besides the integration with unlink & removeVariations, it may be very useful to have a function that only removes the variations from ImageOptim! TL;DR
  44. 6 points
    Same here: I think they are really great! It makes the setup so much cleaner and more readable and also more flexible. For example I'm using a region "scriptsbottom" at the end of my <body> and whenever an included section needs some javascript I just write the markup and append the script to that region: // _main.php <region id="header"></region> [...] <script><region id="scriptsbottom"></region></script> // slider.php <section id="header">... my great slider markup ...</section> <region pw-append="scriptsbottom"> $('#slider').init(); </region> IMHO this is much more readable than using delayed output with php variables and then "messing" around with $config->scriptsbottom .= '$(\'#slider ... ' (doing some crazy escaping or ob_get_clean() or the like.
  45. 6 points
    That's what I'm thinking too. I'd like to add a few neat things though before I actively go for more spotlight on it on the web. Auto save is a neat feature but probably not wanted in all scenarios, so I want to make it optional, and another feature I definitely want to get "wired" in is lool's revision history. Currently, it's far too easy to overwrite a perfectly fine document with no way back.
  46. 6 points
    Ok, I ended up looking into it and from what I can tell the only way is to use the "regular arrays" option, rather than the associative approach. This seems to work: foreach($input->get->amenities as $amenity) { $selector[] = ['amenities.title', $amenity]; } It gets converted to: and the final selector ends up having this, which is what I need. amenities.title=Kitchen, amenities.title=Laundry Maybe this is the only way, but if anyone else has another solution, let me know. Otherwise, hope this helps someone else down the road,
  47. 6 points
    Is your page unpublished? InputfieldPassword is set to required on unpublished pages regardless of what you might have chosen in the field settings - see here. Probably only @ryan could tell you why this is so. You can work around the issue with a hook in /site/ready.php: // You may need to modify "pass" to whatever your password field is named $wire->addHookBefore('Field(name=pass)::getInputfield', function(HookEvent $event) { $page = $event->arguments(0); $field = $event->object; // Do some test on $page and/or $field to identify the cases where the password field should not be required // Then... $field->required = false; });
  48. 6 points
    Update: Seems like I'll switch to agGrid for my module. It is also MIT licensed in the basic version. It can handle multiple thousands of rows (loading 30k rows with pages->findObjects needs 6 seconds here; 10k pages = 800ms; without caching, of course) It has very nice filters built in (contains, starts with, not equal, etc) It is easy to create custom filters -> the regex filter is built by myself It has the possibility of custom cell renderers (see the percent bars; though I will have to adopt how this works for my module) It looks cleaner then datatables It has CSV export that seems to work just as good as the excel export of datatables (it is also possible to modify the cell values before export) I managed to rebuild the column statistics functionality (for all rows and only selected rows) that I have built for datatables. This is a must have feature, making it easy to show eg. the sum of all revenues in a specific month. It is pure JavaScript, so no dependencies have to be installed. It should also be possible to use this module on the frontend quite easily. Only thing that I'm missing from datatables is an easy way to access data. datatables seems to be superior in this regard. But I've also rebuilt this functionality making things like this possible, showing the average value of the grid's "rand" column, taking into account all filters and returning all rows (not only selected ones): return grid.avg('rand', {filter:true, selected:false}); This statement is used for the stats row at the bottom of the grid. Todos: Action items for pw-panel editing Anything else that you think is necessary?
  49. 6 points
    Awesome!!! Thanks!! Thought I've read the whole docs and examples and googled for an hour but found nothing... now it will be a lot more fun working on this tomorrow Maybe I should change the topic title to "everybody who can rtfm better than me, raise your hands" 😂😂
  50. 6 points
    You won't be able to use $log->save() for the reason @alxndre mentioned, and you won't be able to use the admin log viewer because a) it uses new lines to identify each log entry so therefore one entry cannot contain more than one line, and b) it entity encodes HTML for security reasons. But you can use PHP functions like error_log() or file_put_contents() to create your own log file (create the "custom-logs" folder first). $text = date("Y-m-d H:i:s") . "\nHello, how \nare you?\n\n"; // your text, include newlines if needed error_log($text, 3, $config->paths->assets . "custom-logs/mail.txt")