Jump to content

psy

Members
  • Content Count

    546
  • Joined

  • Last visited

  • Days Won

    6

psy last won the day on February 25

psy had the most liked content!

Community Reputation

844 Excellent

2 Followers

About psy

  • Rank
    Hero Member

Contact Methods

  • Website URL
    http://www.clipmagic.com.au

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

4,176 profile views
  1. Thanks for the suggestions. Putting it down to a 'who knows?' Nothing changed and all small images that failed yesterday uploaded fine today. That's net-life for you! LOL
  2. I've searched, and maybe missed, the solution. I have a 'normal' images field and uploading images with a file size greater than 10Kb is fine. Any image size smaller results in the never-ending spinner and no upload. No min/max width/height set on image uploads in admin, ie just the defaults. Any ideas on how to fix? Using: PW: 3.0.175 PHP: 7.3 Marking it as "Resolved" rather than "Solved" as it auto-magically fixed itself. No idea whether PW, PHP, or just an internet hiccough... All good now 🤞
  3. May not be @Sanyaissues' fault. I've had ProCache debug on and then unchecked the Debug checkbox to turn it off and debug stays on. Seems the empty checkbox isn't always respected. Just saying... Nice site 🙂
  4. Thanks to @bernhard introducing me to Tabulator, I've used it in several projects too - both admin and frontend side. It's powerful & fast. Once you get your PW PageArray converted to json, it's just a matter of defining your columns, filters & CSS
  5. @JeevanisM have no answer to that question. It's one I'm asking myself. I truly hope I don't simply to win business, especially for clients who don't need it but are being lemmings and following the hype. I Googled the "benefits of REACT" and every SERP article was written by a JS developer who confused "benefits" with "features". Eg: "It manages state" is a feature, not a clearly defined benefit to the user
  6. I'm really hoping the "everything needs to be node/react/js" fad/hype dies off soon. Twice today on 'important' sites (one an airline booking site), the ajax/promise/whatever failed. Was left looking a never-ending spinner. Awkward as had no idea where my flight booking went. Don't get me wrong, JS is useful but like most things in life, please use in moderation
  7. The repeater parent is not the page that calls the repeater item. To get the page that it appears on, you need to use 'getForPage()'
  8. Yep, everything I had working with AppApi and REACT/NextJS broke with the PW 3.0.173 upgrade. Downgrading is a short-term option but limits future PW upgrade benefits
  9. Doing a little happy dance. Has only taken me a week to figure out how to match React/NextJS to work with @Sebi's amazing AppApi module with pages below the top level, ie routing. I'm sure many of you PHP/PW gurus would have figured it out sooner
  10. @Sebi Thanks for the quick response. I'd already gone past that point both in PW and Postman so the connection is good. I'd even written my own method in Examples to get a page by ID. Maybe not as sophisticated as yours but it too worked: <?php namespace ProcessWire; Class Example { public static function test () { return ['test successful']; } public static function getPageById($data) { $data = AppApiHelper::checkAndSanitizeRequiredParameters($data, ['id|int']); $p = wire('pages')->get("id=$data->id"); if(!$p->id) throw new \Exception('Page not found', 404); $response = new \StdClass(); // Hardcode any data you need that does not have an inputfield field in the admin $response->id = $p->id; $response->name = $p->name; $response->path = $p->path; // This retrieves all the admin input fields. Does not (yet) get page images or files, just single entry data $fields = $p->getFields(); foreach ($fields as $fld) { $fldName = $fld->name; $response->$fldName = $p->$fld; } return $response; } } This enabled me to get the page data into the NextJS client and embed in the 'template/component' as variables from any existing PW page. My next exercise was to delve into the NextJS router so that I could retrieve pages via their path and those paths would appear in the URL. Couldn't work it out in my own PW code (no surprises there!). It was then I installed your Twack module and used the Twack routes & TwackAccess.class.php at which point I ran into the issues mentioned above. I'm sure it's my lack of knowledge of REACT/NextJS rather than your code... Doesn't help when their doco doesn't match up with their examples in gitHub. Even so, it would great to use your TwackAccess classes rather than reinventing the wheel.
  11. Excited to be learning REACT/NextJS. It's so 'on-trend'. I can double my hourly rate, take 3x as long to deliver a website with 2/3 of the Google Lighthouse results and who doesn't love the spinner while the component content loads? Doing a well optimised PW site with minimal JS, fast page loads, accessibility, SEO and more built in is so old hat. And even better, with JS frontends, the code maintenance goes on and on. No end to revenue possibilities. FML
  12. I've read the doco, installed the module & Twack and no matter what I try when retrieving a page, all I get back is a successful Promise or worse, an error message about invalid json. Using React/Nextjs and the page is published, viewable & using the basic-page template. The authorisation is single JWT and the client JS code is: export async function PWPageByUrl(path) { // url is correct and returns a result, just not the one I was expecing const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/${process.env.NEXT_PUBLIC_API_VERSION}/page/${path}`, { headers: { 'x-api-key': process.env.NEXT_PUBLIC_API_KEY, 'authorization': process.env.NEXT_PUBLIC_TOKEN } } ) const data = await res.json() if (!data) { return { notFound: true, } } return { props: { data }, // will be passed to the page component as props } } On the PW server side as per doco with routes modified for v1, I have: I'm obviously missing something. Help to get it working as expected much appreciated. Thanks
  13. Once you've created your $year_overview PageArray, does the template use custom fields from the pages to generate the output? If so, it may be that the slowness is due to multiple calls back to the db during loops to get the custom fields' data. Try including the custom fields in the initial selector with 'auto-join' or using the new methods released by Ryan. https://processwire.com/blog/posts/find-faster-and-more-efficiently/#boost-performance-with-new-programmatic-autojoin-options
  14. It's a premium module but I believe Repeater Matrix will do exactly what you need. It's one of my 'must haves' on every site I create. It's part of the ProFields pack and I use other features on every site too, like Functional Fields . I'll be using the new Combo field as well. The time it saves me is well worth the investment not to mention the great support in the forum from other ProField users & Ryan himself. https://processwire.com/store/pro-fields/
  15. @Rudy & @Craig Thank you both 🙂
×
×
  • Create New...