Leaderboard
Popular Content
Showing content with the highest reputation on 09/13/2019 in all areas
-
As threatened in Ryan's announcement for 3.0.139, I built a little module for sliding toggles as a replacement for checkboxes. Styling of the input is CSS3 only (with all the usual caveats about older browsers), no JS necessary, and may still be a bit "rough around the edges", so to speak, since I didn't have much time for testing on different devices or brushing things up enough so I'd feel comfortable pushing it to the module directory. But here's the link to the GitHub repo for now: InputfieldSlideToggle Fieldtype and Inputfield that implements smartphone-style toggles as replacement for checkbox inputs. The visualization is CSS-only, no additional JS necessary. Status Beta, use with caution Features / Field Settings Size You can render the toggles in four different sizes: small, medium, large and extra large. Off Color Currently, "unchecked" toggles can be displayed either in grey (default) or red. On Color "Checked" toggles can be rendered in one of these colors: blue (default), black, green, grey, orange or red. Screenshots Some examples with checkbox label View all Size and Color Combinations Small toggles Medium toggles Big toggles Extra big toggles9 points
-
In the last few weeks... or almost months... I worked on a project for a restaurant. Sad to say that the company behind the restaurant went out of business before the project could be finished - or was paid or the website ever saw the light of day. As there is kind of a lot of work in it... but yet a lot of customization... I decided to create a site profile of it and make it public as ProcessWire Barebone Site Profile. Right now I'm stripping out every client detail and finish some functions and details that were planned a few weeks back so you can build right on top of it, if you like or want. Maybe it's only a playground for someone or an inspiration for how to f**k up data-mangement... but hey... better than a ZIP file on a backup drive. ? As the project was and is super tailor-made to that client, it may not work for a lot of restaurants out there, but nonetheless I don't want miss the opportunity to offer a foundation for upcoming restaurant projects you may face. The project had a huge focus on dishes, beer and wine variations so those templates are kind of feature-rich. You might want to rip out some of it as most restaurants don't focus that much on those details. Important details I want to be honest and clear about: this profile does NOT include a highly polished and usable frontend as the design is paid and therefore can't be made public the frontend will be a collection of re-usable snippets to show every possible detail of each page, item and whatever the whole site profile will be without any support - future updates aren't planned right now the site profile will be released in single-language setup only (english) existing translations (as seen in parts of the screenshots) will be changed to english existing data, for example dishes, will be replaced with demo content if you, one of your clients or anyone else wants to use this profile - feel free to do so Pro Modules were already stripped out of it only public modules were used and are included with the profile itself the full module list will soon be published on Github the full README will soon be published on Github the full LICENSE will soon be published on Github So... yes... that's just a short preview of an upcoming site profile. As mentioned before, the site profile will most likely never ever receive any future updates, so it will be available on Github only. It's not planned to publish this as a full featured site profile, yet. More details, screenshots and the site profile itself (of course) will be available soon. Questions? Please feel free to ask. Github Repository: https://github.com/webmanufaktur/pwbrestaurant8 points
-
No blog post this week because I don’t have anything new or interesting to write about just yet (unless you like to hear about repairing fridges and clothes dryers). But I’ve been focused primarily on completing the FormBuilder updates that I mentioned in last week’s blog post, and it’s looking very good, though I’ve still got a little further to go with it. When it comes to multi-page forms, I’m trying to cover all of the exceptional cases where sessions expire, cookies clear, etc., and want to make sure a form-in-progress continues to work through all these situations. Multi-page forms can be potentially long and people can invest lots of time in them (relative to regular forms), so trying to make it all as resilient as possible. This takes lots of time developing and testing, so that’s what I’ve been doing. I’ll be doing some of that next week too, though also have been planning to dig back into the core issues repo and start working through some of those in preparation for a new master version this Fall. Hope you all have a great weekend!7 points
-
The easiest I could think of is to export your models into CSVs using this exporter app or by code with this library, and then upload them using ProcessWire's CSV import module. It would require some planning on how you would map your existing data into ProcessWire tree, and its field/template/page paradigm, but it shouldn't be too hard once you've figured that out.3 points
-
I think it's great! I've already incorporated it into my current project, and it has a sizable performance impact on Chrome without any real work on my part. I always thought removing the src attribute and setting it with JavaScript was an antipattern, as anyone with JavaScript disabled wouldn't see any images at all, so it's good to see native support for lazy loading. It's progressive enhancement, so you don't need to have support from all browsers. Support doesn't look half bad though, even though only Chrome supports it at the moment (see caniuse), that's already a sizable chunk of the population. Also, caniuse currently lists Chrome on Android, which is huge (36 %) as not supporting it, I'm not sure that's correct. According to the Chrome Platform Status page, native lazyload is already supported in Chrome on Android. That would get the feature to >50 % browser support already. On current Android versions, all WebViews are provided by Chrome, so it will work in all in-app browsers on Android as well. Also, you can very easily polyfill the native lazyload with JavaScript (see article above), so everyone will profit from this without much of a downside!3 points
-
2 points
-
2 points
-
The easiest answer: you upgraded your local environment a few weeks ago. The more complicated answer: well... yes... don't know. Never had this kind of issue with ProcessWire itself.2 points
-
Not "easier", but fun to dive into: if you have MySQL >= 5.7.8, you could convert the page data into JSON and store that string in the database in an InnoDB table with a JSON column when you save the page. Then use MySQL's JSON_SEARCH function to get the hits and fields (paths). This only works with exact or LIKE queries, though, and you will have a little additional work to convert the returned paths to field names. Of course, you will probably still have to write the nested loops to get the data into the database. Not sure how much FieldtypeRepeater->exportValue() can help you avoid that. Table create statement example: CREATE TABLE jsonsearch ( pages_id INT NOT NULL, pagedata JSON, PRIMARY KEY(pages_id) ) Engine=InnoDB; Hypothetical page data for equally hypothetical page 1013 as stored in JSON: { "name": "vehicles", "title": "Our Vehicles", "data": [ { "type": "motorbike", "color": "blue" }, { "type": "car", "specs": { "colors": [ "red", "green" ], "subtype": "motorbike" } }, { "type": "bike", "color": "black" } ] } Query example: /* Get page id and fields where any field's value equals "motorbike" */ select id, json_search(jsondata, 'all', 'motorbike') as paths from testjson where json_search(jsondata, 'all', 'motorbike') is not null; /* Output: id paths 1013 ["$.data[0].type", "$.data[1].specs.subtype"] */ /* Get page id and fields where field's value contains "bike" */ select id, json_search(jsondata, 'all', '%bike%') as paths from testjson where json_search(jsondata, 'all', '%bike%') is not null; /* Output: id paths 1013 ["$.data[0].type", "$.data[1].specs.subtype", "$.data[2].type"] */ It also allows searching by a field name and by full and partial paths. /** * Search all "type" fields in the page's "data" array (repeater) for the string "bike". * This would find results with bike contained in a field data.type but not in * data.relatedvehicles.type */ select id, json_search(jsondata, 'all', '%bike%', NULL, "$.data[*].type") as paths from testjson where json_search(jsondata, 'all', '%bike%', NULL, "$.data[*].type") is not null; /* Output: id paths 1013 ["$.data[0].type", "$.data[2].type"] */ /** * Search all "type" fields at any level for the string "bike". * This would find results with bike contained both in data.type AND in * data.relatedvehicles.type */ select id, json_search(jsondata, 'all', '%bike%', NULL, "$**.type") as paths from testjson where json_search(jsondata, 'all', '%bike%', NULL, "$**.type") is not null; /* Output: id paths 1013 ["$.data[0].type", "$.data[2].type"] */ Converting the JSON path syntax back to something that makes sense for PW would just mean to json_decode() the paths value, cut off the first two chars and remove the digits within curly braces (though the numeric value are of course the index number for calling eq() on a Repeater/PageArray to get the individual item).2 points
-
Thanks all. I'll be working with a long time PW community member on this. Case closed.2 points
-
I've encountered users who don't even know what a tab is, and are confused when they cannot get back to the site they were on before by just hitting the back button! It's no use keeping your site up in the background if your users don't know how to get back to it ? So on principle I agree with @adrian on this, but our clients still keep asking for target="_blank", so that's that.1 point
-
This sounds even better. I will read the linked article. If we really can use it and have polyfill fallback, we can let out lazyload libraries. That would/will be great. :)1 point
-
WOW NICE! Life is what happens when you are editing template context values.1 point
-
Added support for renaming templates (and related fieldgroups): https://github.com/BernhardBaumrock/RockMigrations/commit/fd465dc27e4f2e3982ed6669da0478df8addfd90 $newTemplate = $rm->renameTemplate('oldtemplate', 'newtemplate');1 point
-
Hi @BitPoet , I added the script within the <head> section and it worked. It'll be better if the jQuery gets loaded directly by the module. Thanks a lot for your help, Cheers!!1 point
-
I agree with you amigo! I'm back to school and they issued us these nice ThinkPads with Win10Pro. I like it, but I do miss my Debian.1 point
-
1 point
-
1 point
-
This has been discussed before. I'm not against it, but I'm also fine with using the module. It works reliably.1 point
-
Hi Folks, this is a bit older project but i thought that I will share it with you - https://icapturemylife.pl/ About 2 years ago one of my friends and clients asked me to build a personal photography blog for himslef. In a day life Mariusz is a professional volleyball player, but in his spare time as an amateur photographer he loves taking pictures and learning about photography. Technically, the site was built from scratch with core PW functionalities, the only module used here is Ryan's "login - register" module - to avoid time-consuming comment moderation, we decided to allow comments only for registered users. In general, the blog is quite simple, but it was real fun to build it with PW! I hope you like it ?1 point
-
1 point
-
Ah, now I see. The script is missing the JQuery library (which is present in the backend). For a short term solution, it should be sufficient to add the following lines within the <head> section of your template: <?php $jq = $modules->get('JqueryCore'); ?> <script src='<?php echo $config->urls->JqueryCore . "JqueryCore.js" ?>'></script> I'll see about either making sure that jquery gets loaded by my module or rewriting the module script so it works without jquery in the long run.1 point
-
wire()->addHookAfter('Pages::saveReady(template=articolo,in_evidenza=1)', function($event) { $reset = $this->pages->find("in_evidenza=1"); foreach($reset as $p) $p->setAndSave('in_evidenza', 0); });1 point
-
If you have proper auditing tools in place then any modifications should be recorded. The other part is authentication/authorization. If you can verify that nobody can modify a certain record you're fine. Those things get tricky though for the people, who are responsible for setting up those systems, because they often also have the ability to circumvent them. That's the place where you want to keep access very restricted to a small set of people, still enable logs where possible and start using policies, which "tell" those people what they're allowed to do and what they're not allowed to do. As soon as you cannot (tech.) prove something wasn't modified you should at least be able to prove that you had other measures, which disallowed modification and to know exactly who had the ability to change things in a non-trackable fashion. There's no fool prove way to this, unless you give up control completely to a third party, and there are always going to be parts in your setup, which are best effort instead of watertight. From my understanding a good part of an evaluation by authorities will include not just technical checks, but also softer targets like proper training for personnel, written evaluations and documentation.1 point
-
You could try using the FieldTypeDecimal module for this. If I remember correctly, there is a setting to specify number of decimal places in there.1 point
-
You don't need to mess around gulp etc anymore if you don't wanna. Give https://prepros.io/ a try. After I switched from Mac to Windows, I missed Codekit and Prepros is a good alternative. :) Also runs on Linux (as it's an Electron app).1 point
-
I know I am getting OT, but I almost never use target="_blank" anymore. Here are a few thoughts: https://css-tricks.com/use-target_blank/ I think the key thing for me is that it's really hard to prevent opening a new tab when it is used, but it's really easy for the user to choose to open in a new tab if they want, so my rule is that unless the user will lose unsaved form data as a result of opening a link in the same tab, I never force a new tab.1 point
-
DEPRECATED - see the new version here: Brand new module that I've built because I'm too lazy to always open the calculator when I have to do some calculations (like vat calculations etc): It adds some magic to FieldtypeDecimal, FieldtypeFloat and FieldtypeInteger fieldtypes. Of course you can define which fields you want to extend: https://github.com/BernhardBaumrock/MathParser Any ideas or contributions are welcome. What do you think about the name? What do you think about the styling?1 point