Jump to content

psy

Members
  • Posts

    552
  • Joined

  • Last visited

  • Days Won

    6

psy last won the day on February 25

psy had the most liked content!

2 Followers

Contact Methods

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

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

4,295 profile views

psy's Achievements

Hero Member

Hero Member (6/6)

853

Reputation

  1. @bernhard Normally I use MarkupSimpleNavigation and cache each 'page' menu with the appropriate 'active' class set. This menu is so small I decided only to cache the PageArray then output to the front end using a foreach loop and test to see if the page was 'active' and add the CSS class accordingly in the template. Wanted to bring it to attention in case it's a 'gotcha' for others working with custom page classes and cache. ๐Ÿ™‚
  2. Loving the custom page classes but I ran into an issue. I wanted to cache the main navigation items to save DB calls. Set up is: site/classes/HomePage.php site/classes/BasicPagePage.php and templates: basic-page.php home.php In _init.php: <?php namespace ProcessWire; // Get the nav items and save them to a cache /* This crashes with Error message: User Error Exception: Can't cache multiple page types together: HomePage, BasicPagePage (in /home/xxxxx/xxxxxx/wire/core/WireCache.php line 954) */ $menuItems = $cache->get('menuItems', 3600, function() { $pp = wire('pages'); $items = $pp->find("id=1|1028|1031|1029"); // Home, Gallery, Testimonials, Contact return $items; }); bd($menuItems); // Without saving to cache works fine $items = $pages->find("id=1|1028|1031|1029"); // Home, Gallery, Testimonials, Contact bd($items);
  3. @Warran Yes, yes and yes As in my original post, both the page & repeater matrix field use the 'body' field. It's a textarea with CKEditor + TextformatterVideoEmbed and the body content source code is the same
  4. Having strange issues with this one as well. The field is 'body' and it has the TextformatterVideoEmbed option. On the same page, I have the YT URL in the page's body field. It outputs the URL. Below it, I have a Repeater Matrix field with the same body field and content and it outputs the video. Any ideas? Edit: I have found a cause but not the fix. My code is: <?php $featured = false; if ($page->hasField('images') && $page->images->count > 0) { $featured = $page->images->last; $description = !empty($featured->description) ? $featured->description : $page->get("headline|title"); } // ... ?> <?php if (!empty($page->body)) : ?> <div class="main__body owllob"> <?php if ($featured != false) : ?> <img class="main__feature-img" loading="lazy" src="<?=$featured->width(300)->webp()->url?>" alt="<?=$description?>" /> <?php endif; ?> <?=$page->body?> </div> <?php endif; ?> When I include a 'featured' image and even though it renders separately to the body field, the YT URL does not convert. When I delete the image, it does and the video shows/plays as expected???
  5. Quick update... Finally figured out to get React/NextJS to work with a basic (minimal field types to convert to JSON) PW site. Giving self a pat on the back when I discovered Svelte ๐Ÿ’ฉ Svelte felt (I'm a poet & didn't know it ๐Ÿ˜) so much more like PW - JS, HTML & CSS with 'state management' and no shadow DOM. The only problem was routing. I'd spent far too long figuring out React/NextJS routing and Svelte offered no immediate solution. The old (like 2yrs) way of routing was called Sapper. Development on Sapper has ceased with all efforts now focussed on the new way, SvelteKit which is in pre-beta (๐Ÿ˜ณ ). Anyhoo, went with SvelteKit and got it working. I've only scratched the surface on what's possible with React/NextJS and Svelte. Both offer Server Side Rendering (SSR) making the site SEO friendly & fast-loading. Given a choice, I'd choose Svelte every time. With both React/NextJS and Svelte using @Sebi's AppApi with customisation depending on the framework, I: created a home page that pulls the data from the PW home page created a 'slug' page that pulls the data from the PW page url and displays it in a component based on the PW page template as returned in the page JSON, and shows the correct route in the URL from a nav menu In both cases, the page layout is not a PW template but a conditional component file. Anyone else tried Svelte with PW? Your thoughts & comments welcome
  6. I'm running 3.0.175 on a dev site and all works as expected for editing admin templates & fields. Have you tried reverting to the PW default UiKit admin theme? Maybe something to do with the custom admin theme you're using
  7. 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
  8. 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 ๐Ÿคž
  9. 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 ๐Ÿ™‚
  10. 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
  11. @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
  12. 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
  13. 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()'
  14. 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
  15. 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
ร—
ร—
  • Create New...