-
Posts
6,264 -
Joined
-
Last visited
-
Days Won
314
Everything posted by bernhard
-
Thx, I've seen that screenshot but was not sure how the module is actually used. I've been using the TextFormatter solution so far so that clients can just copy/paste youtube urls and get the embedded video. So my question was to better understand how this module is intended to be used. How it compares to other solutions (like Textformatters). How they could maybe be combined or if that is not the idea etc. I either don't agree or don't understand. But I guess it means that the module does not provide any helpers to make the embedding comply with gdpr and that is something that the developer needs to take care of?
- 17 replies
-
- fieldtype
- inputfield
-
(and 1 more)
Tagged with:
-
Hi @Neue Rituale your module looks great. Do you have some screenshots or showcase links? What are you using the module for? How do you handle GDPR?
- 17 replies
-
- fieldtype
- inputfield
-
(and 1 more)
Tagged with:
-
If I did a simple foreach() with WireHttp() and a single request would take 1s then it would take 100s to request all 100 domains. That would mean that after 60s the next cronjob would be started and the timestamp of all requests would be heavily out of range. Eg a cronjob started at 12:00:00 would get its results at 12:00:00 + 100s = 12:01:40 which is really not what I want ?
-
NICE! Single url: 6 urls: Now to you also have a version that limits the number of concurrent requests somehow. The idea I have in my mind is to build some basic uptime monitoring service like uptime kuma. If I had 100 domains to monitor and every request takes 1 second I can't monitor all domains every 60s. On the other hand I don't think it would be a good idea to let curl fire 100 concurrent requests, would it? Also not sure if I'm really going to build this, but it would be fun I guess ?
-
$http = new WireHttp(); $t = Debug::timer(); $http->get("https://www.google.com"); $http->get("https://www.google.com"); $http->get("https://www.google.com"); db(Debug::timer($t)*1000); This adds up some hundreds of milliseconds for each request. Is there a way to send those requests concurrently so that it takes roughly the same time for 1 and for multiple requests? I know that Guzzle supports this, but I'd prefer to use PW core tools ? https://docs.guzzlephp.org/en/stable/quickstart.html#concurrent-requests I didn't find anything for the terms "concurrent" or "simult" in WireHttp.php so I'm not too optimistic but I'd be happy to be wrong ?
-
editor - Login failed, changing password via API did not work
bernhard replied to 700ml's topic in General Support
I think that would explain the behaviour! Have you tried changing it to those values? Column Type Comment pages_id int(10) unsigned data char(40) salt char(32) -
Great read @FireWire, thx for sharing! It reminded me of a conversation with a fried that builds WordPress websites and is very happy with it. It was a terrible meeting to be honest, because I was struggling with my business at that time and I was thinking about what I could change or where I could focus with my skills and with the strengths that ProcessWire has to offer. But he is that kind of person that is better in talking than in listening ? So while I was telling him the reasons for my struggles (like for example that it takes a lot more time to build a website with ProcessWire than it takes to click something together with WordPress and some plugins) he was all the time responding with, "yeah, WordPress is great, we are using Elementor and my junior employee who was a parcel carrier one year ago builds a website for a client in 3 hours and we charge 1.500€ and everybody is happy. That really hurt in that situation, because I think it's the way the industry works (maybe a little exaggerated, which is always the case with him ? ). At least a big part of it. Also, I lost a client because their ProcessWire website was too inflexible. It was too static. So what you @FireWire describe as a benefit is IMHO a big limitation of ProcessWire. We have RepeaterMatrix, but it's still very hard to build a website with flexible building blocks (sections) that the client can rearrange as he/she needs. So the client moved from ProcessWire to WordPress. The main reason was exactly what you mentioned @FireWire: "We need a dev for every change". I think their new website is terrible but unfortunately I don't have any info on how happy they are with the current setup. But I understand that clients have that need. So I built RockPageBuilder. It's been in development for 2 or 3 years now and tries to find the sweet spot in between those PageBuilders that allow the client to to everything (adjusting fonts, colors, paddings, margins or even worse nesting elements so you need a degree in web development to use it) and ProcessWire, where the developer is the only one that controls the layout. It lets the developer easily and quickly define the building blocks of the website (like cards, text, headlines, gallery, single image, etc) and lets the client easily and quickly use those building blocks without having to think of paddings, margins, colours, font sizes or responsiveness because that is defined by the developer who knows how to make it work best for all situations. I'm sure there are niches or websites that don't need this flexibility and that can benefit from the tight skeleton that a developer provides, but in my experience this is not the case for most of the market and that's a problem in my opinion and that was basically the question that I was having in my head when asking for help from my friend and the main driver for building RockPageBuilder. But that's not the point of my post that is getting too long already (sorry for that ? ). Why did I mention all that? Because with all those problems in my head, the solution of my friend (WordPress + Elementor = 3h = 1.500€) sounded terrible for me and I guess you can now better understand why. I thought maybe I have to switch to WordPress as well. Maybe I should build modules for WordPress rather than for ProcessWire ... BUT - and that's now the point of this post and the insight that I took from the meeting with my friend which turned it into a good, helpful and at least somewhat motivating meeting. After telling me for over an hour how great WordPress is and how easy it is to manage for his clients ("every ape understands that in one hour") and after showing me how that really looks on a real life website I thought: "Well, I don't think it is really THAT easy." All the options, all the settings, all the things that could possibly go wrong... It just didn't look like something I'd like to work with (both as a dev and as a webmaster). Then I asked: "And your clients manage their websites on their own?" He: "No, they don't want to. It's so simple, but still, they don't want to do it and pay me good money to do it for them." That was strange. My clients typically manage their websites completely on their own. I don't hear from them very often or at all. It's a totally different experience. I thought a lot about that statement and the whole meeting. If it was really that easy, why would almost all of his clients pay him for doing it? That made no sense. Until I realised: Maybe it is not THAT easy. Maybe these great page builders are not that great for everybody. Maybe less (options) can be more (ease of use and fun). And that perfectly fits what you said @FireWire And (unfortunately) it perfectly fits to this as well: But I can't help. I want to have fun with what I'm doing and I don't want to charge my clients money for managing sites that I've built because they can't to it on their own. --------------- PS: Screenshot tools like greenshot for windows or shotter for mac can help a lot here. Or you could record a video easily (and for free) with a service like https://screenpal.com/ or https://calipio.com/ - maybe that helps ?
-
Thx for sharing nonetheless! I'm thinking of adding such a feature to RockFrontend so your module is definitely a welcome inspiration ?
-
Hey @zx80 great to have a new module author ? congrats! FYI: You can also just copy and paste the link to the ZIP file into the "install from url" field then you don't have to rename anything. I see that you inject both the JS and the CSS file in the site's head. I wonder what you or others think about that approach to inject such small files into the site. I think since HTTP2 it should not matter but tools like pingdom speedtest still show the "number of requests" as KPI. Personally I'd prefer splitting things into multiple files and then just including them over complicated build tools. And I'm already doing it similarly with RockFrontend. But I'd be interested what others think or if anybody has some good resources to read.
-
Howto create and add language files to own modules
bernhard replied to cwsoft's topic in Multi-Language Support
Am I the only one thinking that the core way sucks? -
It sounds like you are looking for sharing code/functionality across multiple instances. That's what ProcessWire modules are for. ? You put the logic in one module and all instances can use it. It's really just a few lines of code. Much simpler than in many other frameworks: https://processwire.com/docs/modules/development/
-
2023 Update ? RockMigrations (must-have for all projects for automated deployments and because it installs several other modules for me with one click) TracyDebugger (for obvious reasons) RockFrontend (for zero-setup livereload, asset management and auto-minify, automatic less parsing and last but not least: LATTE ? ) RockShell (to grab data from staging or production via "php rockshell db-pull" which will then download user-uploaded files via RockMigrations filesOnDemand feature) ProCache ? Not a module, but also a must-have: Custom Page Classes
-
@Cybermano It should be quite easy to ignore cloned pages in your hook: $wire->addHookAfter('Pages::saved', function ($event) { $page = $event->arguments(0); if ($page->_cloning) return; bd($page); }); Use tracy debugger to inspect the saved page objects and you can see if there are any helpful properties (like _added for example).
-
Do you make own designs or do you use finished designs or toolkits?
bernhard replied to BlindPenguin's topic in Pub
+1 I've had the same discussion with a tailwind fan some time ago... IMHO he was reinventing the wheel over and over again. Every slider on every project was built differently (with AlpineJS which is one popular answer to your question). Every modal was built differently. Need tooltips? "npm install something" ? Or even worse built on his own again and not thinking about edge cases like tooltips moving to a different position when the hovered element is on the edge of the screen where there is not enough space for the tooltip ... Whenever I had to fix something on the frontend it was terrible. Just adding a class to an element? Nope... No luck without prior doing "npm run watch" and usually seeing many mysterious warnings in yellow and red... Fix some issue with a slider? Understand all the custom logic that was built with AlpineJS and directly written to the DOM. To be fair I'm not the best frontend dev on earth, so some problems might have been beginner things, but still these things are definitely drawbacks of that approach. One day he showed understanding and said, "Ok, you are right, let's build components that we can reuse. What components do we need?" I told him to have a look at the UIkit docs ? ? On the other hand a framework has some overhead of course. And like @teppo said the components can be hard to customise or maybe they even don't work in a way you want to. I guess it's about priorities and there is no right or wrong. Though the customisation part is 90% a bad argument imho because in UIkit you have plenty of options to customise every component but you have the benefit that you have proper docs, so every team member can quickly understand how everything works and you have a common ground to build on. Maybe UIkit is a little more like WordPress and Tailwind is a little more like ProcessWire. On the one side you take something that does a lot out of the box and then you adopt things (which is usually faster but less custom) and on the other side you start from scratch and build just what you need. And those mentioned frameworks try to find a spot in between I guess. Offer a quickstart but still being as flexible and efficient as Tailwind. -
Hey @Cybermano what exactly are you trying to do? If you only want to make the clone unpublished you can add this line before $copy->save(): $copy->addStatus(Page::statusUnpublished); I've some questions and suggestions for improvements on your code (assuming that the only difference to my old post is that the cloned page should be unpublished): Why do you set $page to unpublished during clone and then restore the previous state? That's 2x unnecessary page saves. You are using setAndSave for name + title, but you save() the $copy later anyhow. That means you produce 3 save operations instead of one. Just use $copy->set('name', ...) and same for title and changes will be stored on save() You are using setStatus(). It should be fine but I think it's better to use addStatus() in general unless you really want to force a single status. For example pages can have a "corrupted" status and that will be removed on setStatus() but will be kept when using addStatus() - please anybody correct me if I'm wrong ?
-
Howto create and add language files to own modules
bernhard replied to cwsoft's topic in Multi-Language Support
Adding translations to modules sucks. That's why I built RockLanguage: https://processwire.com/talk/topic/27199-rocklanguage-a-new-way-to-ship-processwire-modules-with-translation-files-%3F/ The idea is that the module author is responsible for the translations and that it's as simple as possible to translate everything and keep everything up to date. I have not used it for a while though and it never got any traction in the community, but I still think it is the best way to do it. The official way is by far too tedious. There are so many necessary steps for just translating a single string. And if something changes you have to do everything over and over again. Terrible. RockLanguage automates all that for you. If you find that anything does not work any more let me know and I'll fix it timely. If you want to help on developing the concept further let me know! -
editor - Login failed, changing password via API did not work
bernhard replied to 700ml's topic in General Support
Maybe you need to set your field_pass table to ascii_general_ci ? At least this is what it shows for me. Maybe that's messing things up? -
You don't need composer for RockForms. But if you are building some intranet-like app as @dotnetic mentioned the most efficient way is to stay in the PW backend. To understand the backend better you can read my blog post here: https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/ But creating a complex app with lots of calculations is not an easy task - so if composer is out of your league I'm not sure if it's a good idea to take over such a project. Maybe it's better to build on an existing solution as @Jim Bailie mentioned. But that's of course your decision ? Just wanted to mention that you can achieve anything you want with PW and with the PW backend, but it's definitely more complex than using composer. And your comment about PW needing a page title does not sound like you know a lot about hooks or the inner workings of PW. It's of course your decision, just be aware that if you price it with a flat rate then you might end up with a lot more work than you'd expect ?
-
I've built a commercial module RockForms that can be of huge help here. It uses https://doc.nette.org/en/forms which is the only library on earth that I know where you define all rules from within PHP and get the same exact validation rules also on the client side for live validation. You have tons of options regarding validation and you can even create nested validation rules: https://doc.nette.org/en/forms/validation The drawback of using Nette Forms is that it makes it very hard to customise the created markup of your forms to your needs. That's where RockForms jumps in. Also it integrates everything very well with PW and creates pages from submitted forms, provides hookable methods to do custom stuff at custom events and handles redirects to prevent double form submissions etc.; Basically it handles all the tedious things for you that you'd have to think of upfront or that you have to fix later if you didn't think of them ? A simple form could look like this: // create form with a unique name $form = new RockForm("demo"); // field setup $form ->addText("forename", "Enter your first name") ->setRequired("We need your first name to show it!"); $form ->addText("surname", "Enter your given name"); $form ->addSubmit("submit", "Submit your name"); // render output if ($form->showSuccess($values)) { $name = $values->forename; if($values->surname) $name .= " " . $values->surname; echo "<strong>Thank you for submitting the form, $name!</strong>"; } else { echo $form->render(); } Or for more complex forms you can define everything in OOP style. Extensive docs are in the works and provide live examples that you can play around with: https://www.baumrock.com/modules/rockforms/docs/ Compared to FormBuilder the module does not (yet) have a UI to build forms. That's done in code, but it seems that this is what you want anyhow?! Single Site License will be 49€ - if you are interested write me a PM ?
-
Hey! A client wanted me to update their website to make it show dates in the form "1. - 3. Jän. 2023" instead of "1. Jän. 2023 - 3. Jän. 2023" It's a small change but not so easy to solve, especially if you want to make it locale aware etc... So I've created "HumanDates" library which is not a PW module but a standalone PHP class so that everybody can easily use it even outside of the PW universe: https://github.com/baumrock/HumanDates Usage is simple and the library can be used as a strftime replacement: // manual download require_once "/path/to/HumanDates.php"; // using composer // composer require baumrock/humandates require_once "/path/to/composer/autoload.php"; // create HumanDates instance $dates = new HumanDates(); echo $dates->format("2023-01-01"); // 1. Jan 2023 echo $dates->range("2023-01-01", "2023-01-03"); // 1. - 3. Jan 2023 If it is useful to you please let me know by giving it a star on github ? https://github.com/baumrock/HumanDates/stargazers PS: It will be available in RockFrontend in the next release simply by calling $rockfrontend->humandates() ?
- 15 replies
-
- 14
-
editor - Login failed, changing password via API did not work
bernhard replied to 700ml's topic in General Support
This sounds weird. I don't know enough about character encoding of databases if that could also be the reason for such a behaviour though. What could result in something like this is if a hardcoded password is set somewhere before ready.php - This would explain why it works as long as the line is present in ready.php but as soon as you remove it it does not work any more. Can you log in as admin, then create a new superuser in the backend and then check if the login for that user works persistently? -
editor - Login failed, changing password via API did not work
bernhard replied to 700ml's topic in General Support
$users->get("name=admin")->setAndSave('pass', 'yoursupersecretpassword'); If you put that in ready.php and visit your site once (load any page), then you still can not login? Have you also tried logging in from an incognito window? Maybe some cookies are messing things up? -
Do you make own designs or do you use finished designs or toolkits?
bernhard replied to BlindPenguin's topic in Pub
Hey @AndZyk thx for the update! Have you seen https://github.com/TomS-/UIKit-TailwindCSS/blob/master/postcss.config.js ? I think you can use Toms regex. So the interesting part for me would be how we could add that to RockFrontend? I'd much more prefer a PHP way to do it similar to the LESS parser. But I did not find a solution on my research. Yeah that's why I did not add it to my workflow until now. But if it were really plug-and-play it would be nice, maybe.. -
Do you make own designs or do you use finished designs or toolkits?
bernhard replied to BlindPenguin's topic in Pub
Well it should be possible, there is https://github.com/TomS-/UIKit-TailwindCSS/blob/master/postcss.config.js but I'm looking for an easy way ? Something that I could maybe plug into RockFrontend