Jump to content

Tom.

Members
  • Posts

    461
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Tom.

  1. Hi All, Recently I've been trying to improve my development skills with R&D projects. My skills are mostly with HTML, PHP and Javascript. I class myself as a front-end developer however I can build back-end applications. I remember when Web 2.0 was realised and there was a shift in ideology and a design guideline to come along with it. But recently things are moving quicker than ever. I'm seeing a huge amount of people dropping jQuery in favour of ES6. But more than that, they are using framework's like React, Angular and Vue. Recently I learnt about JAMStack, and idea that you use API's to generate a flat file website which you serve through an CDN and honestly, I'm feeling way out of my depth here. I really want to stay up to date, but it seems developing a website is like engineering an engine, once you get to the top end of "speed" making it go faster is 100x harder. Don't get me wrong, I'm happy with the performance of ProcessWire, but these JAMStack websites are blazing. I guess you could call this Web 3.0 and it's all about speed and lightweight. Things like ASYNC and lot of other things that can come together to make a pleasurable experience even on the slowest of mobile networks. Is all of this a fad or is it really the next big movement? Is that how we should be developing websites now, or are they just buzz-words? I do like the idea of the CMS generating flat files and routing that through a CDN, but also using Git to manage all the changes it seems very fluid. (https://www.netlify.com, https://github.com/netlify/netlify-cms). I would love to learn all of this, but I feel like there is so much to catch up on I don't know where to start. Like, what is gulp? postCSS? I guess they are pre-processing like LESS to have all this power but still serve small files over the browser. As you can probably tell, I'm overwhelmed by all these things and it doesn't stop, now the "next big thing" is Gatsby (https://www.gatsbyjs.org) and whatever happened to Node.js? I feel like I'm going crazy haha! My question is, how do you guys deal with all of this? Is it something that ProcessWire can be used with as ProcessWire uses a database and requires PHP. I recently read: which touched upon these things, but I didn't understand it all.
  2. I would encourage to do that, it also means you can use something like Page Auto Complete so you don't have to scroll through a huge dropdown trying to find the airport you are looking for but instead you can just type it out.
  3. You have more than 6000 options in the select field? I would say if that's the case you should switch to using Pages and Page Reference.
  4. Try editing the field with the issue, going to Actions, check "Check field data" and hit save. Not entirely sure if this is a fix, however might be worth a shot.
  5. Maybe I miss-understanding, but you have a day_in_week field, what kind of field is this? Before I can answer the question, as this changes the way you can achieve this. For example if it's just text you can do: $events = $pages->find("template=weekly-event, day_in_week=Monday");
  6. Thank you so much Robin, I really appreciate it!
  7. Thanks, sadly that returns the error "Can't save field from a new page - please save the entire page first". Maybe I will just have to rethink how this is going to work if that's the case, shame I thought it was a really user friendly way of handling product variations.
  8. @Robin S I've updated the forum post with a step by step guide, I'll also add that to the github post.
  9. Added step by step guide: 1. Create a new template called bug. 2. Create two repeaters one called repeater_1 and repeater_2. 3. Create a text field called text and add that to repeater_1 and repeater_2. 4. Add repeater_1 and repeater_2 to the bug template. 5. Add this code to ready.php: $wire->addHookBefore("Pages::save", function($event) { $page = $event->arguments("page"); if($page->template == "bug") { for($i = 0; $i < 3; $i++) { $p = $page->repeater_2->getNew(); $p->text = "Bug"; $p->save(); } } }); 6. Create a bug template page and add content to repeater_1. 7. Click save, you will see that the content for repeater_2 isn't saved, however 3 repeater_2's are added. 8. Remove $p->save(); from the provided code. 9. Add content to repeater_1, you will see that content is added however only 1 repeater is added to repeater_2. $p->save() causes any other repeater to not save, I believe this also applies to Page Reference (see: https://github.com/processwire/processwire-issues/issues/430)
  10. You replied to it. For Github - I have elaborated on the steps to reproduce as suggested. I did however, include a video and example code in the bug report. I also in bold, isolated the exact issue.
  11. Thanks for the great update @ryan, any chance you could have a look at github? https://github.com/processwire/processwire-issues/issues/434 This bug is preventing me hitting a deadline. I'm worried I may have to swap to dare I say, WordPress until it's fixed. Its for an eCommerce system I'm building for a client which I will be releasing Open Source once completed. This guy seems to be having the same issue - https://github.com/processwire/processwire-issues/issues/430 just in a different context. Basically using save() in the hook Pages::save causes repeaters or page references not to save. Edit: Do you have a paid service in which you can pay to push bugs to the top of the list when it's deadline critical?
  12. I guess what you are asking is how do we get more casual developers interested into ProcessWire? As in you said, you don't want to learn how to connect these frameworks up to ProcessWire. I don't think ProcessWire currently fits in a market where everything is module or theme. While it has the features to be. It just doesn't have the audience. I would say nearly everyone here is a developer that writes bespoke websites for their clients. I think trying to compete with WordPress in its versatility to just pick up, install a theme and a couple of modules and off you go. Could damage ProcessWire. For example a lot of WordPress websites get hacked due to the fact that modules/plugins installed aren't secure. I personally like where ProcessWire sits, it's really easy to pick up and learn, the API is by far the best of any other CMS available. However it takes the patience to learn. However not everything is handed to you. Go out and learn how to hook these frameworks into ProcessWire. I promise you, you won't regret it. And then why not release it as a profile? That's how the community and library gets bigger.
  13. I'm not sure of the likely hood for a default site profile including these. Minify CSS/JS is included in AIOM and ProCache - I don't think this will make it's way to the core. There is a UIKit Site Profile which is using - https://getuikit.com Am I miss understanding your question?
  14. Yeah, I'm starting to think this is something to do with mod_security or timeout. The script seems good? That or it's a bug with ProcessWire. It has the appearance of a mod_security issue blocking the fields from saving. But I don't know. Usually when that happens if effects all fields. Edit: Checked, mod security is turned off
  15. Thanks for the suggestion, but sadly not the case. Here is a quote from Ryan: "It shouldn't be necessary to do the $page->repeater->add($repeater); as the getNew() method already does that."
  16. Tried setting both $page->of(false); and $new_option->of(false); problem still exists.
  17. Solution: $p->save(["uncacheAll" => false]); Edit: Added step by step Hey guys, I'm building an eCommerce for ProcessWire which is coming along nicely. However I've come across a bug which I can't seem to figure out what's going off and why. I've put up a post on GitHub, but I know Ryan is a busy man and I am currently working on this 6-8 hours a day. https://github.com/processwire/processwire-issues/issues/434 Here is a link to the issue.
  18. I'm hoping to release it in alpha early next year. It will come as a site profile which has a starter theme and everything.
  19. @ryan, Hi Ryan, I've come across quite a major bug, but I can't seem to tell you exactly why it's happening. Maybe I can send you a copy of the files and explain to you? I'm building an Open Source eCommerce system for ProcessWire and I've come across something very weird.
  20. @ryan I can't seem to find any way to sort repeaters in the backend. Do you have any news on this? I tried going to where you said however nothing about sorting shows up in Family.
  21. Yeah, slightly strange argument. My argument is if UIKit is the right way to go all together. I'm going to say something crazy, but I think it should be built with little to no dependencies. I feel like these bugs are appearing due to all these dependencies and different systems trying to work together jQuery UI, UIKit both have JS that do the same thing. Some things are using jQuery UI some things are using UIKit. Often there are strange bugs with repeater AJAX like fields having a slightly different design when loaded through AJAX. Like the Page Reference field using AMS for example. Personally, I see the ultimate admin panel is from the ground up, following a guideline with every single tiny element considered. Like how should things collapse when next to another element. But so far I'm loving the UIKit version, it's looking great. Just I think a future goal should be it's own system.
  22. No idea why my original code it wasn't working, I've given it another go and it's working now. $wire->addHookAfter("Pages::saveReady", function($event) { $page = $event->arguments(0); if($page->template == "repeater_variations") { $title = array(); $check = array(); $i++; foreach($page->variation as $variation) { $parent = $variation->parent->title; if(in_array($parent, $check)) { $this->error("Variation #$i had a duplicate ". strtolower($parent) .", the duplicate has been removed."); $page->variation->remove($variation); } else { array_push($check, $parent); array_push($title, "$parent — $variation->title"); } } $page->title = implode(", ", $title) . $parent_title; } }); Thanks for you help. EDIT: Silly me, it was because I wasn't making changes to the repeater when testing, there for it wasn't firing saveReady.
  23. Strange, I can't get the first one working. I would assume it did work since when saving a page, repeaters also save to a page. To explain what's happening, I'm building an eCommerce system and front-end that I'm going to release open source for ProcessWire. It's in it's early stage and I'm mostly mapping the UX. The variations are variations of a product, this is a repeater on the product page. The variation you can see that I set as an array are titles from a PageReference field, that lets you select things like colour and sizes for that variation. The hook is to change the title field in the repeater to those titles, the repeater uses this title field for the name of the repeater item. For example "#1: Color - Red, Size - M" the title is a hidden field, used purely to show what product variation that repeater is. It does other things like check if there is two colors selected, and deleted one informing the user that it shouldn't have two from the same group. Sadly I still haven't figured out to do it without defining $repeater->save() inside the repeater foreach on page save. Which seems really inefficient.
  24. This would imply the password you have used is incorrect, also please don't post sensitive information, such as your database password. I would remove that urgently before anyone breaks any other websites you may have hosted on there. Not that I would say anyone in this community is like that, you just never know.
  25. Really struggling with this one, I do wish there was more info on hooks. I'm trying to update the repeater title on save, my initial idea as when you save the page, it saves repeater which is also a page (under the hood): $wire->addHookAfter("Pages::saveReady", function($event) { $page = $event->arguments(0); if($page->template == "repeater_variations") { $page->title = "Hello"; } }); This isn't working at all, so I've been looking at Captain hook on repeater hooks and found this: $wire->addHookBefore("FieldtypeRepeater::savePageField", function($event) { $page = $event->arguments(0); if($page->template == "repeater_variations") { $page->title = "Hello"; } }); This still isn't working. So I tried accessing it from the page: $wire->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments(0); foreach($page->variations as $variation) { $variation->title = "Hello"; } }); And still nothing. Anyone got any ideas on this? EDIT: I've done this for now, I know it's not efficient at all as save is probably called twice on each repeater. But it works: $wire->addHookAfter("Pages::saveReady", function($event) { $page = $event->arguments(0); foreach($page->variations as $variations) { $title = array(); foreach($variations->variation as $variation) array_push($title, $variation->title); $variations->title = implode(", ", $title); $variations->save(); } });
×
×
  • Create New...