Jump to content

Chris Ernovsky

  • Posts

  • Joined

  • Last visited

Posts posted by Chris Ernovsky

  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? ??


    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. On 12/14/2014 at 11:06 PM, Jan Romero said:


    $page->download_counter = $page->download_counter + 1;

    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
        wireSendFile($page->download->filename, $options);
    • Thanks 1
  3. 4 hours ago, szabesz said:

    The weakest point of WordPress has always bee not relying on well established design patterns but on custom, ad-hoc solutions they made up as they went.

    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.

    13 hours ago, Jonathan Lahijani said:

    I've been following WP's Block Editor development on-and-off since it was announced.  I was hoping for the best and something very well thought out given they could make core changes to WordPress to facilitate a great experience, but it seems, at least from my point of view, chaotic and disjointed.

    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.

    • Like 2
  4. @bernhard, thank you very much for replying!

    1 hour ago, bernhard said:

    I have no idea how hard that would be to build and maintain. I'm afraid of that, so I'll not do it ?

    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! ?

    • Like 2
  5. 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?

  6. 6 hours ago, teppo said:

    There is zero interest here to move ProcessWire away from what it does now, or somehow get rid of the way it handles structured data. Absolutely zero. If you're worried that someone wants to thrash the system we now have and replace it with a Gutenberg clone, fear not: that will not happen, period.

    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... ☺️

    • Like 3
  7. On 1/8/2021 at 9:54 PM, ryan said:

    Flexible content or page building 

    One of the most common themes has been that people want more content building options as an alternative to using a rich text editor at one end, and page builder at another. This is a direction that some other CMSs have been going in (like WordPress), and one that many would like to see ProcessWire provide an option for as well.


    First would be a flexible content block style editor in the core as an alternative to rich text editor that supports pluggable block types while maintaining best content management practices. If possible, we'd use an existing tool/library like editor.js or another as a base to build from, or potentially build a new one if necessary. To be clear, it would not be a replacement for CKEditor but an alternative approach supported by the core.

    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!

    • Like 1
  8. On 11/8/2015 at 8:40 PM, LostKobrakai said:

    You can get the timestamp of the date when accessing the unformatted field data like so:

    $ts = $page->getUnformatted("datefield");
    $day = date("d", $ts);
    $monthYear = date("F Y", $ts);

    @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. ?

  9. On 5/4/2012 at 8:56 PM, ryan said:

    You could also create and add a checkbox field to your template(s) and call it something like "sticky". When a page has the box checked, it will stick to the top of the list. Then when you perform the call to load your pages, sort by -sticky first, then by -date, i.e.

    $pages->find("parent=/news/, sort=-sticky, sort=-date");

    @ryan, I know it's an ancient thread, but I'm slowly finishing my first public/client site with PW and this "sort=-sticky" trick has just blown my mind... ? I've got few crossing loops with different layouts and was trying to implement some kind of clever sticky mechanism onto all my find/sort structures. I was almost there with checkbox conditions but decided to look around here for a little help. Found this thread, adjusted and put your suggestion into my project and... started to dance and scream. ? PW is PHENOMENAL!

    I'm learning PW API for few weeks intensively and I'm more and more thrilled. Thank You and all Devs so much for this wonderful CMF/CME!

    • Like 2
  10. Hi! 

    Thanks a lot for the updates!

    I took me over a year to finally dig into PW and start to use it in more serious way and I've been doing it for few weeks now.
    First of all I'm catching up with A LOT of things here and trying to do things properly.
    Learning to use Git and GitHub for a start... ?

    Now. I've started a new project with PW which will be a base for other projects and our customs solutions.
    Your package is a gift from heaven here but there are still minor typings errors or tentative translations.
    I'll try to step up here a little bit and instead of opening an issue I'll try to fork your project and make some commits where necessary.
    Hope you don't mind such a path.

    Zdrowych (!!!) i radosnych Świąt Wielkanocnych! ?

    • Like 1
  11. You were right of course - after upgrading to 3.0.122 (from 3.0.98),
    everything is displayed correctly in Polish (see the attachment) and works like a charm.
    Relogging after changing a language also does the trick. Thank you!

    I'm learning to walk here so please forgive me lack of knowledge.

    Now I'll try to play around with modifing a ready HTML/CSS/JS template
    and connecting it to PW.

    No new projects and no deadlines so far
    so I can climb that hill at my own pace. One step in a time. ?

    Jeszcze raz bardzo dziękuję za pomoc i pozdrawiam ciepło.


  12. Wonderful!

    I've found out lately that the translation depands also on a UI administration theme -
    when default is used it's all translated but with UIkit theme there are several places in English.
    I assume that it needs to be translated elsewhere (if necessary).

    For me it's better to work in English but for clients / authors it's of course unacceptable.
    So once again - thanks a lot!

    Last weekend I've shown PW few guys in two companies and explained the idea.
    They are very intrigued and one of them is planning to try it for building a PHP/MySQL app
    for their company administration. So it's good to know that we don't have start from scratch with translating.

    Wielkie dzięki i pozdrawiam serdecznie!

  13. Hello @7Studio!

    I was just curious if there is a newer translation and here we are.
    Tomek, great job, all is working fine (PW 3.0.98 on localhost).

    I can see that there are still some phrases in English. I don't know if this has been your choice to leave them like that or was it rather lack of need / time.
    I'm a newbie here (just converting from WordPress after almost a decade) and still learning everything,
    but after few weeks I'm planning to build a bigger site with PW and there will be several places that will have to be in Polish.
    If you need some help with translating - let me know.

    Pozdrawiam ciepło,

    • Like 1
  14. Hi @bernhard!

    Gutenberg in Wordpress is a dual misconception:

    • Wordpress is known as a blog platform. Yes, you can extend it massively and use it for many different projects but in the end it's mostly about operating with text. It's usually enriched with images and embeds but it's still an article, news, etc. So many authors for so many years just copied and pasted their texts, added few media and with 2-3 clicks published it. Now, doing this simple task with Gutenberg is insanely uneffective: instead one simple menu in editor there are several (hidden) menus everywhere (in every block). And EVERYTHING is a block now - a title, a paragraph, an image, a quote and so on (imagine the amount of additional code it generates!). You have to do absurdly much more things to get the same result and you have to spend much more time to do the simplest task.
    • So maybe Gutenberg is for designers rather? If it's true and if this was the idea (to simplify building content) - there are so many so much better WP site builders and themes (to do so) FOR YEARS! Anybody who wants a one-page site or portfolio just picks up a theme and few plugins and voila. The core blogging mechanism stays safe and ready when necessary.

    I can understand that Matt, Automattic and the dev-deciders want to turn with WP elsewhere and change the character/purpose of the platform. Their choice (though the style they're doing that is embarrassing). But cutting out all those (millions?) of websites using WP for TEXT PUBLISHING and trying to convince the whole world that Gutenberg is better tool to write an article than TinyMCE or CKEditor is as funny as idiotic.

    From practical point of view, Gutenberg is incompatible with so many plugins and themes (used stably for years!) that it broke hundreds (thousands?) of websites. Blank sites, errors, bugs everywhere AND in many cases people have no idea where is a problem and what to fix. At my site (mentioned above) I have 50 plugins. Half of them doesn't work or generates errors with Gutenberg. Just take a look at the reviews of Gutenberg (and their dates!) to catch the disaster happening there.

    I know perfectly from my own experience how such a "click click drag-and-drop magic" approach can be tempting.
    Probably even using PW at some point (it's still ahead of me!).
    But it's the whole different way and phillosophy of creating (fast) content. There are all those Wix, Weebly, Spacesqare and Mobirise builders for that.
    WordPress as it was thought in the beginning shoudn't go that way (that 30% of web share will fall quickly).

    • Like 5
  • Create New...