Jump to content

Chris Ernovsky

Members
  • Posts

    25
  • Joined

  • Last visited

Profile Information

  • Location
    Poland

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Chris Ernovsky's Achievements

Jr. Member

Jr. Member (3/6)

38

Reputation

  1. Hi Everyone! I'm sorry in advance if my issue was solved somewhere here (haven't found it) but I've stuck with sorting... I've got a field where I put Polish surnames and sorting pages by it displays incorrect results according to Polish alphabet: "ą" shoud be after "a", "ć" after "c" etc. Now these letters are treated like English ones. So for example displayed surnames "Bać, Bąk, Bal" shoud be in order "Bać, Bal, Bąk". My selector is let's say: $guys = $pages->find("template=guy, sort=guy_surname"); And I don't have an idea what to do now and how to change this sorting. I tried to use some PHP sort functions but didn't make it working properly (or at all). Maybe there's a much simpler PW-way solution? Any help or tip? 🙏😳 EDIT: Of course there's a simple solution. 🙈 $guys = $pages->find("template=guy"); $guys->sort("guy_surname", SORT_LOCALE_STRING); Now I'm trying to figure out how to paginate the results AFTER sorting. But that's not crucial for us in this case. EDIT #2: This place is - as always - a den full of treasures. 🤩 I've used PaginatedArray and adapted this code. It allows me to conviniently divide pages with hundreds of items which were sorted properly earlier. 👍
  2. The same in our case. AVIF or JPEG XL?
  3. 😄👍 Just checked it - works properly as well. Any particular reason of resigning from 'find' in $event? My programming skills ends somewhere around 'if' statements and playing with PW selectors... 🙈 Efficiency in queries? Structure of methods?
  4. Dear @bernhard & @Noel Boss, I LOVE this wonderful hook! Works perfectly. Huge thanks! 🥰
  5. I don't know why but the above incrementation line didn't work for me. Using '+= 1' didn't work either. I had 'unsupported operand' errors or a counter couldn't start counting from 0. Maybe it's something with sanitization of integers or PHP version - I don't have such knowledge. BUT at some point I tried shorter '$page->download_counter++' and it works at all scenarios. So my final (working) code looks like this (maybe it can help someone): // $page->download is a field with files // $page->download_counter is an integer field for counting downloads if ($page->download) { $options = array ( 'exit' => true, 'forceDownload' => true ); $page->of(false); $page->download_counter++; $page->save('download_counter'); $page->of(true); wireSendFile($page->download->filename, $options); }
  6. @ryan & @renobird - huge thanks to both of you! We've got 2022 and it's still working perfectly. 👌
  7. Soooo true! In consequence, devs have to follow that and do the same. We have so many WordPress sites which have grown in years and and now they are stupidly patched with our homegrown snippets, patches, hooks, etc. And lots of them have been frozen against updates because of incompatibilities or/and Gutenberg. The only option is to build such a site from the beginning. In some cases we did. The same. I get the idea. I just don't buy the WP way from the very beginning. After 3 years of Gutenberg it doesn't get any better. And this is an opinion of our clients/administrators. I've never liked it so I'm not objective here.
  8. @bernhard, thank you very much for replying! I'm at the same place right now... 😄 It haunts me from time to time to build my own theme with admin structure reorganised a little bit. But I'm not there yet and there are (always...) more important things to do. Anyways, you've made a simple yet powerfool tool to play with styling. I'm already using it and love it. So once again - thank you! 🙌
  9. First of all, many thanks to @bernhard for this fantastic contribution (and for all he's done for PW and the its community). I must say I'm not a big fan of UIkit and prefer Bootstrap by far, especially now with 5.0 version which is so easy to customize thoroughly. I was even thinking about creating BS admin theme for myself (and clients) but - as my dev friend says - time, time, time... I get used to PW UIkit admin theme but it always annoys me with its esthetics and code. Now I've got a very convenient tool for changing few things so thanks a lot for that. I do all by the book, it works fine, I can adjust the look. Not always as I want to but it's caused by my ignorance of UIkit and PW admin theme structure I suppose. The question is: how far can I go this way? Is it only - as mentioned above - a quick method to change some colors OR can I dive in really deep here and change UIkit/theme A LOT to maybe even exchange the whole framework at some point (does it take effect on different parts of PW)? In other words: is it universal way (LESS compiler) or would it be simpler to create a new admin theme (module?) completely?
  10. This is EXACTLY what I had to hear. Thank you! 🤞🙌 I'm open to any new approaches and improvements with .js editing/building as an option. Just don't want to lose my new, beloved home... ☺️
  11. Please... just... don't. 😔 👉 https://wordpress.org/plugins/gutenberg/#reviews We've been there 3 years ago with WP. The same discussion, the same requests. The rest is history... or rather anoying present. I've started using PW because of its bare bone flexibility as a backend and text/content editor (not builder!). I don't know too much about all that PW API magic (which I truly admire) and barely scratch the surface, but that's more than enough to build a lighweight customized website with a desired design (here just customized Bootstrap + few js libraries). I don't need and I don't want any builders for that. Clients are extremely happy with very simplified admin dashboards and some of them ran away from Gutenberg and other WP builders last year. I'm perfectly aware that there are different clients, developers, trends and expectations. I just feel (and see) that we're overcomplicating and overbuilding websites (and tools) these years... Just sighing, Guys... All the best to Ryan and the whole PW Community in 2021!
  12. @MoritzLost - huge thanks! I needed exactly such a link/module to clear all kind of cache. PW 3.0.156, PHP 7.4, OpenLiteSpeed - works like a charm. 👍
  13. @LostKobrakai, thank You for this! I have to split a date/time field into day of week, day, month and time in a loop (an archive of events) and couldn't figure it out. I saw this function at forums several times before but didn't know I can use it with date. Awsome! Thanks again for the tip. 👍
  14. @Greg Lumley, you took every single word out of my mouth... Happy coding, Bro!
×
×
  • Create New...