Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/02/2022 in all areas

  1. I can recommend the VSCode extension "Project Manager": https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager I have every project as own workspace with all root folders (site and wire) included and can easily switch with the project manager. The wire folder is excluded for opening files via the command palette. This way Intelephense knows everything, but I don't get suggested files in the wire folder. 😉
    3 points
  2. Just wanted to share what I've just found: https://get-deck.com/ It looks like a nice Docker environment with a simple GUI and lots of options. I'll try it for the next projects.
    2 points
  3. RM1 had support for RepeaterMatrix so it would likely just be copy&paste: https://github.com/baumrock/RockMigrations1/blob/1ee9f9eb4afaf83529bcedf443b31dd63a5403c8/RockMigrations1.module.php#L1336-L1384 So if you think RockMigrations is missing anything why don't you stop complaining and start asking me if it is already possible or if I can implement it? Why do you think that? ----------- Sorry, but I have to say I'm getting a little pissed with you guys talking about migrations. It's like you were sitting in front of your TV eating chips and watching a documentary about mountains. And you say: "Wow, that views are so great. It must really be awesome to see that in real life! I've dreamed about that for a decade (yep, quoting you here @Ivan Gretsky 😉 But I don't mean you exclusively with the protagonist in that story )." And then I tell you: "I built a car. It stands in your garage. You simply have to get into it, learn how to drive and 5 hours later you are there! It's great, I'm going there all the time and it's such a great experience and once you've been there you'll never want back. Ah, forgot to mention: You can take my car for free!" And you: "Oh, well... Thank you... I totally appreciate that. You know... it's just... driving a car?! I've never been driving a car... And... You didn't say anything about the car-radio... Does it even have a radio? You know, it's so important to me, because I always hear the news on radio!" And you continue eating chips and watching TV... Me: "You'll learn how to drive in 10 Minutes. It's an automatic car. The previous car had a manual gear shift, but the new car that I built has automatic gear shift, so you really just need to sit in, steer the wheel and push the break or the gas pedal." You: "Well... I'm afraid I could cause an accident! That's really kind of you, but I'd much more prefer if there was a train to that mountains! That would be great! I'm sure the one that builds the train thinks of everything that I need. A radio. I could even take my Laptop with me and watch TV during the ride. I'd be the first to buy a ticket for that train (yep, quoting again)!" You continue eating chips... Me: "Sure, I was also afraid when I first drove a car. But believe me: It's really not hard! And you can go really slow at first and of course, you don't start driving that car on a real street! You go to a big free area where no obstacles and no people are so that you can't hurt anybody or yourself. I have even made a video about how to drive the car." You: "Ok wow, thank you, I have to try that!" You eat the rest of your chips. --- one month later --- Me: "Did you drive the car already?" You (eating chips and watching docs about that great mountains): "Oh... well... yes... I tried... But it does not work. I think I'll wait for the train to be built!" Me: "Ähm... Why? What is wrong with the car?" You: "Nothing... it's just... it is too complicated for me. It's for sure great if you drive cars daily like you do. But for someone like me it's too complicated. It would be much easier to go by train. That would be so great, that mountains look so awesome. I'd love to go there one day." You open a new bag of chips. -------------------- Get your *** up and stop eating chips! Watch that movie and get into that car! Go to a free and safe area and practise. Once you did that I'm happy to hear feedback how the car could be improved. Maybe we need to add cruise control. Or maybe we need to put sunglasses in the car. Or maybe we need to place a sticker on the outside of the car that says: "If you want to drive that car you have to enter on the front seat where the steering wheel is. You can't drive this car from one of the back seats." Or maybe you say "I've tried. I drove the car two hours, but it was terrible. It was loud, it was exhausting. I was not able to watch TV while driving." That's fine. If that is really what you want, then the car might not be the best choice for you. But one of my points is: We have that car already! The train would have to be built. If it is only about you not being able to stop watching TV and eating chips you could also pay someone to drive the car for you. Or you could pay me to add a self driving mode into that car. And for the noise: I'm happy to get those reports and then we can decide if it's something to take care of (to make sure the car does not explode while driving) or if it would be enough to just use oropax until the car get's its silent driving mode. Another point is: I know that it sounds totally great to get into the train, continue watching TV and eating chips and arrive relaxed at the mountains. But you can't go anywhere else. With the car you have the flexibility to go anywhere. And you can go on top of the mountain whereas on the train you'll arrive at the train station and you have to go the last mile by foot. So jump into that car and stop asking for a train by pretending that there is no other way to go to the mountains! Do you get my point? I'm not against having a train to the mountains. But @thetuningspoon's message is like saying "I have thought about it. To go to the mountains we'd need a vehicle that can carry passengers. We'd need an endurance of at least 6 hours, because the mountains are 5h away. It should drive forward by default. Going backwards should require an extra step of caution because it might be more dangerous to push back with that vehicle." Me: "Yeah, you are describing my car." You: "Hm. I thought more of something like a train..." --- So if you don't want to ride that car for whatever reason: Please start describing your train properly and add notes what should work differently to the car that we already have and why. PS: Read the title of this thread... "Build a vehicle to go to the mountains and add gps tracking". Did I already say that my car has gps tracking??
    2 points
  4. This week I'm happy to report that the InputfieldTinyMCE module is now released. It is currently released in the modules directory and GitHub but the plan is it will be merged into the core, likely before the end of the year. No need to wait till then though, as you can start using it today. Please consider the module in beta for the moment, though the TinyMCE library itself is in a stable state. A lot of the work that went into developing this module went into the configuration aspect. Here are a few a more details that weren't covered in last week's post: After installing the module, on the module configuration screen, you can decide whether several settings should be configurable for each field, or if you want to just configure them with the module (affecting all fields): One of things that I thought was important was to make it a lot simpler to add custom classes/styles to the editor. I always found this kind of a pain in CKEditor. So in TinyMCE, I made it so that you can just define these custom styles with the field settings using just simple CSS definitions. InputfieldTinyMCE takes care of converting to a format that TinyMCE can understand (for its menus), as well as the styles to show in the editor. For instance, I wanted to add some common Uikit text classes to a custom "Uikit" group in the Styles dropdown: And here's the result in the editor: The markup produced has the correct Uikit classes in the markup so that on the front-end of my site the output is Uikit ready. You can add 3rd party or your own custom plugins from the module settings: And then you can enable them for any field in the field editor: These are just a few interesting tidbits, but there's a lot more. Also, if you didn't see last week's blog post, that covers a lot more too. Either way, I'd encourage you to download InputfieldTinyMCE, give it a try and please let me know how it works for you. If you come across any bugs, please open an issue report. Thanks for reading and have a great weekend!
    1 point
  5. @DrQuincy, you could use JavaScript to remove any disallowed characters from the input if the href is a tel link: $wire->addHookAfter('ProcessPageEditLink::execute', function(HookEvent $event) { $event->return .= <<<EOT <script> $(document).ready(function() { $(document).on('blur', '#link_page_url_input', function() { var href = $(this).val(); // If the href is a tel link if(href.startsWith('tel:')) { // Remove any disallowed characters href = href.replaceAll(' ', '').replaceAll('(', '').replaceAll(')', ''); $(this).val(href).trigger('change'); } }); }); </script> EOT; });
    1 point
  6. Looks like MarkupHTMLPurifier used to skip tel: links in the past due to HTML Purifier not supporting them. This bypass was removed in 3.0.137, so after that version tel: links have likely had to adhere to stricter rules. I would likely go with this option, to be honest. But perhaps someone else knows how to customize Purifier — I've tried it once or twice, but eventually had to give up 🙂
    1 point
  7. I do use Project Manager already and it's definitely a must have extension. Cool. Whilst we're sharing tips though - on a Mac you can set up a Quick Action in Automater to open a folder in VS Code: the command I've got in that Quick Action is open -n -b "com.microsoft.VSCode" --args "$*" On my Linux box I'm using Dolphin on KDE and get offered the option to 'Open with VSCode' when I right click on a folder ... I think thats just happens by default; I don't remember ever setting that up.
    1 point
  8. If you can believe it, I could have really used that feature just this saturday, when I had to downlod multiple images with a fiddly laptop touchpad 😄 I’ll check out your SASS module (I’ve often wondered why that’s not the predominant way to do it, actually. Sounds awesome!) and get a PR going, but it’s going to be a couple of days.
    1 point
  9. @thetuningspoon I completely disagree, because that is farther removed from the goal of having a declarative dec config and closer to the territory of migrations. You don't want to give the system a list of instructions on how to build the correct state, you want to have a declarative list of configuration values that describes the correct state. Getting there happens under the hood. Similar to the difference between declarative or functional programming and imperative programming - you only describe what to do, not how to do it. The system can compare the list of fields in the config and in the database, add and remove fields as needed, and update config values. Combined with version control, this allows you to go back seamlessly to any previous state, revert changes to the declarative config etc, which is something that migrations struggle with, as mentioned. I understand the hesitation to have the system outright delete anything that's missing from the config, but that's just a combination of not going 'all-in' on the declarative config, or not embracing some important workflow changes along with it. You want the config to be the single source of truth for the state of the project, independent of any existing installation or database. If you take an existing 'base' state (for example, tracked in version control as a database dump of an existing installation) and only include changes relative to that base state in your config, you're not there all the way. You want the config to include everything, every field, template, setting, installed plugin, etc. This way, a new installation (for example, a staging environment for a specific feature) can ideally be created with a single console command. Once you have that, you don't have to worry about having the system delete fields that aren't in the config, because deleting a field from the config requires the same amount of effort and has the same visibility in your quality control pipeline as adding one. The rest is just a question of workflow. Changes to the config should be tracked in version control, and merging those changes should require an approved pull request (if you're working in a team). Deleting a field is just as much of a change that is visible in the PR as adding one, since you will see the deleted field config in the PR and make sure that this is really what you want to do. Once you have a solid workflow in place, you can confidently delete everything that you no longer need, because you know you this change will go through review and quality control, and you can get it back through version control if you really need it again in the future. Of course, mistakes still happen. Turns out the client still had some vital data in that field you removed? Well, that's what backups are for. The first step in every deployment script should be a backup. Yes, absolutely. Though in a perfect world, changes to the config are only made in development environments, tracked in version control, and then deployed to the live site (after any staging environments in between). Pulling the config and applying it should be done as part of the deployment script. This way, there is rarely a need to have a button in the backend that applies the config (though this is still useful for development). The more you can automate deployments and get rid of manual steps, the better. This allows you to work in smaller iterations and get features out faster and with more confidence. The Phoenix Project is a great read on that subject!
    1 point
  10. @bernhardthanks for pointing me in the direction. It was a bit complicated to find a solution in that topic but apparently there is a simple way. My pages are as follows: Home - Departments -- Department1 --- CategoryA --- CategoryB -- Department2 --- CategoryX --- CategoryY I made one Input Field Type 'Select', type 'page reference', parent set to 'Departments'. I made one input Field Type 'Select', type 'page reference', no parent set, no template set, selector string is 'parent=page.department'. Then it works perfectly. But when I would set a parent for that last field type, the pages using those two dependent fields won't save - so it is best to not set a parent page there.
    1 point
  11. Good day, community! I have found another great opportunity to support PW ecosystem - just look here! This is @teppo's sponsorship page. He is doing such a load of super cool and useful things, that sponsoring him is a sure must))) Please start throwing your money at this fine gentleman)) Pitifully I cannot do it myself now easily, but I'll find a way. I almost feel guilty for not paying for Wireframe)) I've updated my other post with the modules' authors accepting donations list - just in case. You can check other great sponsorship chances there.
    1 point
  12. Hi @kongondo, Sorry for the long silence. I finally had a chance to look into the demo and am amazed that your VAT validation code is already 99% functional! I just had to take into account the country prefixes and now it runs like a charm. Anyway, one milestone passed, and the next one is just around the corner. I’d like to store the customers VAT number in OrderCustomer so I can display it on the confirmation page and on the invoice. I guess I need to add a custom field to the OrderCustomer template, right? I’m not sure where to do that, unfortunately. My second issue is to show a note on the invoice if Reverse Charge applies (customer has valid VAT number and gets an invoice without VAT). My idea is to hook in __orderSaved and add this hint to the order using the Notes feature. Unfortunately I have not found any information about this in the demos and the forum. As always, I appreciate any hints and help. Thanks!
    1 point
  13. Hi @ryan I made a small function to help Slavic translations. function my_decl($n, $forms){ $modulo = $n % 10; $dec = $n % 100; return $n . ' ' . (($dec > 9 && $dec < 20) || $modulo > 4 || $modulo == 0 ? $forms[2] : ($modulo == 1 ? $forms[0] : $forms[1])); } echo my_decl($leta, ['rok', 'roky', 'let']); // cz echo my_decl($chas, ['година', 'години', 'годин']); // ukr echo my_decl($girls, ['девушка', 'девушки', 'девушек']); // ru Czech version: When $leta=0, it returns the string '0 let'. When $leta=1, it returns the string '1 rok'. When $leta=2, it returns the string '2 roky'. When $leta=30123, it returns the string '30123 roky'. When $leta=30120, it returns the string '30120 let'.
    1 point
  14. @Erik - it doesn't look like @Pete is maintaining this module anymore. Give https://processwire.com/modules/protected-mode/ a go - it also has the advantage of optionally sending proper 503 headers when you're using it for blocking access during maintenance downtime.
    1 point
  15. Just for the records: There is a simpler solution now: $siblings = $page->siblings(false);
    1 point
×
×
  • Create New...