Jump to content

bernhard

Members
  • Posts

    6,266
  • Joined

  • Last visited

  • Days Won

    314

Everything posted by bernhard

  1. Hi @Stefanowitsch at the moment it scales linearly, but you can define the min and max viewport for that. I've added a page to the wiki: https://github.com/baumrock/RockFrontend/wiki/PXREM---GROW-(fluid-font-sizes) Does that explain what you were asking? Or do you want to a custom non-linear scale function (like easing)? That would be possible I think but I'm not sure how practical it would be. Input is welcome. The scale factor in the code is basically there for RockPageBuilder ?
  2. Hi @gornycreative I'm not sure I understand? Did you see https://github.com/baumrock/AdminStyleHello ?
  3. Update: I think it's possible by using 100% 100%, see https://codepen.io/seyedi/pen/KKzeRxE
  4. Thx for that! I feared that it works like this. That shows the problem that I'm facing! This is how "contain" works: And this is "cover": But what I'd really want is that the SVG streches all the way over the background image to make a perfect "border" around all edges. No matter what size the background image has (portrait or landscape). So I'm looking for something like a "stretch" setting. You know what I mean?
  5. Any chance you could share a fiddle or codepen? ?
  6. Great writeup thank you very much for sharing all that with us! Maybe @horst has some input here?
  7. Update: I've decided not to add a merge feature to RockFrontend's asset hadling. The reason is that it has more drawbacks and really not any benefit in 2022, see https://gtmetrix.com/blog/should-i-combine-css-js-files-on-my-website/ But we have an automatic minify feature now ?? https://github.com/baumrock/RockFrontend/wiki/Auto-Minify-Feature If you enable the auto-minify feature RockFrontend can automatically create and load minified versions of your assets. It does not do it 100% automatically to let you have control over what you which assets you want to minify and which not. To use the minify feature simply add .min to your asset path: $rockfrontend->styles()->add("/path/to/your/file.min.css"); RockFrontend will then check if file.css exists. If so it will check if file.css is newer than file.min.css and if that is also the case then it will recreate the minified file using matthiasmullie/minify. The same applies to scripts()->add("/path/to/file.min.js") --- Why merging is a problem: One huge problem is that $rockfrontend->styles()->add(...) makes RockFrontend create a file /site/templates/bundle/head.css Now what if we added a merge feature? How would we call that file? Because on every single page the content of that file could be different, as on some pages there might have been styles added (eg map.css and map.js for a web map) and on others we don't have to add those assets. If we merged all into a single file we'd have to find a way to create different merged files and manage them and make sure to import the correct one. No. That's not good. Especially as with HTTP2 there is no reason for merging files. Quite the contrary, as browsers seem to perform better in general if assets are split into chunks rather than one huge file.
  8. Absolutely stunning site! Congrats. I'm a little sorry for not choosing UIkit, but in the end the result counts and it looks absolutely great!
  9. Haha, I think I've never actually used that myself, but I read about it some day in the blog and it sounded really useful and I think it would have been really useful in some of my hooks where I solved it differently (more complicated I guess) ?
  10. I think it should be enough to just remove the hook once it got triggered? It's definitely better to add the script in the renderReady method rather than hooking buildForm or something, because in buildForm() you don't know whether your alpine field will be rendered or not (or you'd have to check that yourself and don't forget about nested fields etc...). <?php $this->addHookAfter('AdminTheme::getExtraMarkup', function ($e) { $parts = $e->return; $parts['head'] .= "<script defer src='https://unpkg.com/alpinejs@3.10.2/dist/cdn.min.js'></script>"; $e->return = $parts; $e->removeHook(null); // add this line });
  11. The latest version of RockMigrations comes with a console on the module's settings page. What does that mean? It is now easier than ever to create custom "site-profile" like installation scripts that you can just copy and paste into that console. Add or remove the lines that you need or don't need, check the checkbox to run code on save and hit the save button!! ?
  12. Love that ? RockFrontend uses this syntax which I think is simpler and better than array syntax, because you don't have to think about all the custom attributes one might need. It's simply a suffix as a plain string: $rockfrontend->scripts()->add("foo/bar.js", "defer"); // the last part is simply a string, so you can do anything you need ->add("https://code.jquery.com/jquery-3.6.1.min.js", 'defer integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"');
  13. I've been using panels a lot in the past but I switched to using modals as they seem to have more features like the one you are asking for. Maybe it's also possible with panels, but I've done it using modals and adding the "data-autoclose" attribute to the link. This is a link created by RockFrontend's Alfred editor: <a href="/cms/page/edit/?id=1047" class="icon pw-modal alfred-edit" data-barba-prevent="" data-buttons="button.ui-button[type=submit]" data-autoclose="" data-reload=""><img src="/site/modules/RockFrontend/icons/edit.svg"><span class="alfred-cover" title="" uk-tooltip="" aria-describedby="uk-tooltip-34" tabindex="0"></span></a>
  14. Hi @MikeF77 welcome to the forum and to the world of processwire ? The thing here is: ProcessWire is very different to other CMSs in that it does not dictate HOW things are done. It just tries to make all the complicated things easy so that you can focus on building your ideas rather than having to fiddle around with all the technical parts. So for example it helps you to resize images properly ($page->your_image_field->maxSize(400,300)->url), but it has no default way of how images are managed. So there is no central media manager or such. That might be important to understand when looking how things are done. That means in your case you don't need to understand how ProcessWire works, but you need to find out first how the company built the website. To understand that you could inspect the file /site/templates/home.php --> that is the template file for the home page and it is rendered when anybody opens http://yoursite.com Maybe you could share the content of that file? Or a screenshot. Without any sensitive information of course. Then we could maybe give better instructions ? Or maybe with the video posted about things are already clearer? Also have a look if there is maybe a file /site/templates/_main.php ? Let us know what you find and we can help I'm sure ?
  15. In some recent discussions some of you mentioned that profields like the combofield are essential to you. I'm curious: What do you use the combo field for? How do you use it? Some examples would be nice ? Thx! @Ivan Gretsky
  16. I try to find an easy and solid way to apply a rounded mask to an uploaded image like in this example: It seems that clip path does not support such rounded paths? https://bennettfeely.com/clippy/ Then I tried to place a white SVG above the image to fake the effect, but that was 1) ugly and 2) did not work with portrait images. Don't know if I did anything wrong but I was simply not able to make the overlay stretch to the parent container to have the same size as the underlaying image. How would you tackle this?
  17. <?php namespace ProcessWire class FooPage extends Page { // "location" one public function migrate() { $rm = $this->wire->modules->get('RockMigrations'); $this->cleanup($rm); $rm->migrate([ 'fields' => ['foo', 'bar'], 'templates' => ['footpl', 'bartpl'], ]); } // "location" two public function cleanup($rm) { $rm->deleteField('baz'); } } RM does not have this approach. But you listed that as "another approach could be" so I did not take that into account. I was not sure what you meant by "outside changes" and with your latest post I see that you where more thinking of a GUI way rather than a code solution. So my 100% are maybe a little too much and I'd say you did an 80% description of RM ? But I still don't think it is a good solution. Think of the excel macro recorder... It produces a total mess and you have no control what it does. I don't want that for my projects. I understand that it could work and I'm thinking about that all the time, but I still don't have a good solution. If someone else found it: PERFECT! Please let me know!! I released the module for free so that everybody can use it, everybody can see the code and improve it. But instead of doing that I see a lot of people begging for "a way to go to the mountains". That's what annoys me. It's the way they talk about ProcessWire and RockMigrations. And that's what I tried to express with my story about the mountains. It's a totally different story if you say "I want to go to the mountains and I tried your car, but I had a huge tent with me (proField) and it did not fit into the baggage compartment (was not supported by the createField() method). PS: RM works the other way round: You write "code" (it's actually a lot more plain PHP arrays that represent field/template settings) and the changes appear in the backend like magic (when using RockFrontend for live reloading as shown in the video). 100% RockMigrations: First it creates all fields and templates: https://github.com/baumrock/RockMigrations/blob/df2ccefe2df49134c16b622c07e308864880827b/RockMigrations.module.php#L2177 And then it applies all settings: https://github.com/baumrock/RockMigrations/blob/df2ccefe2df49134c16b622c07e308864880827b/RockMigrations.module.php#L2198 You explain 100% how RM works in the paragraph above and end with "unless someone else hasn't already gotten to it". ? I know how you mean it but maybe you can understand that it's not nice to read for me... You are quoting me totally wrong here. I did never say that I don't understand why anybody would have a need for them! Quite the contrary, I've bought almost all if not all profields. Some because I use them on every project (ProCache), some because I used them in older projects before I had my own solution (RepeaterMatrix) and some just to support Ryan's great work and free CMS that has helped me in so many ways and is still so much fun to use. I'm just not keen on adding support for them in my spare time, for free, for people that don't contribute anything to our community. It would be a totally different story if someone asked me to add support for it and sponsored that addition. In RM1 that happened and I see no reason why that should not happen in RM2. And I also see no reason for not adding a trailer hitch to my car so that others can use it with a trailer to bring all their baggage to the mountains... And I don't think I have to justify that ? At the moment no, but I'm happy to accept PR's in any of those directions and for example the last one would be extremely easy to add ? For Field/template cleanup I want to add that we both know that this is an unfair argument. You know that this would mean that you'd need to list EVERYTHING in your config before, so that you can afterwards remove one part and make the module remove that as well. So while that might sound a little more comfortable it is just so much more bloat and has so many drawbacks that I thought it would be better to just add those things that are defined in config and if I wanted to remove something simply use deleteField() or deleteTemplate() etc. But it does not mean one could not build it that way. But again: Why should I build that if I don't work that way? Give me a reason and I'll do it (if you don't want to). Yeah I don't know exactly what problems I had, but I've tried using the internal export/import syntax (as it sounds so obvious and good), but it somehow did not work for me. I might revisit that at some point but I had to get things done so I implemented the array syntax (which is by the way a lot more intuitive to use for humans than the core export/import syntax that is built for computers). I don't see any reason why RM should not be able to support any other field. RM is just an abstraction layer between the human brain and the PW API. The admin interface uses PW API to write GUI interactions into the PW database. So you could also just use PW api if you wanted. But I realised that using the PW api for creating fields/templates/etc is really not as easy as it could be (see createField() as an example) and it does not work the way the human brain works. And our brain works the way the PW GUI works, so we think "create a new template" and we don't think "create a new fieldgroup, then create a new template and assign that new fieldgroup to that new template". At least my brain works that way. And that's all RM provides. An easy to use API that can do anything for you that the PW GUI can do (and even more). Everything that we have in the GUI we have in the core API. RM just provides helpers to trigger the right methods in the correct order and catch edge cases etc. If you find a way to use core json export/import for RM then great. Please let me know and we can work on a solution that supports profields out of the box! Glad you had fun reading it ? I didn't want to offend you @Ivan Gretsky but sometimes people need a helping hand and sometimes they need a kick in their *** and it's not easy to know when they need what... It sounded like you really want to do migrations so I thought maybe you need a push. If you need help I'm happy to answer all the questions you have. Just please be precise in your explanations and don't do "I tried it but it simply did not work" kind of feedback... Because others might be reading that and might get a wrong impression. And well, yes, I'm happy if people are using the module and liking the module, since that is the only "reward" I get from it (besides being a lot more productive and a lot more professional in my daily work).
  18. Thx for sharing! Not sure I totally understand what it is doing but I'm always opening projects via spotlight + terminal: "cmd + space" to open spotlight search enter "iterm" and hit enter to open iterm terminal type "code myprojects/project.com" and hit enter --> vscode opens that folder/project ?
  19. 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??
  20. You did an 100% exact description of RockMigrations. Really, that's exactly how it works.
×
×
  • Create New...