Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/23/2023 in all areas

  1. BasicPagePage.php class BasicPagePage extends Page { ... } You take whatever template name you have and convert that to camelcase, eg basic-page = BasicPage, foo-bar = FooBar, home = Home and then you add the suffix Page to that name (FooBarPage, HomePage). In case of BasicPagePage it sounds a bit weird and I've myself done that wrong several times when I forgot the suffix and just called it BasicPage.php and wondered why it is not working. But once you get the concept it's easy and makes sense ?
    2 points
  2. @digitalbricks Checking PHP documentation it's necessary to combine 2 flags, both combinations work: $a = ['a','b','C','A']; sort($a, SORT_NATURAL|SORT_FLAG_CASE); // a, A, b, c sort($a, SORT_STRING|SORT_FLAG_CASE); // a, A, b, c EDIT: cross-posted ?
    2 points
  3. Hi all, This is our new website, still based on Processwire since 2015, we are very happy to be able to work with such a good piece of software. Thanks everyone for the support. https://velvetyne.fr You can read more about this new version here https://velvetyne.fr/news/new-website-v3/
    2 points
  4. I am very exited to launch PAGEGRID on Product Hunt today ? You can support it by upvoting or giving feedback here. And while you're there don't forget to give your love to processwire too. PAGEGRID is a friendly pagebuilder for ProcessWire. Learn more Thanks for your support!
    1 point
  5. Thanks! Appreciated! ? about it, in times of utf8(mb4) one might want to use CHAR_LENGTH instead of LENGTH. The first one counts the code points, i.e. visible characters, while the latter returns the bytes. LENGTH('?') is 4.
    1 point
  6. 1 point
  7. Good luck. I always fail at that ? And also good luck with the docs. I know how much work that is, so don't let that feel you bad. It's not easy.
    1 point
  8. One of the things that has had UIKit 3 folks jump ship to tailwinds or another system is the lack of CSS Grid support. Having looked into it a lot I started working on something to addon but discovered it has already been done by the Beaver Builder people and their addons pals. Beaver Builder is a page construction kit for WP. https://www.wpbeaverbuilder.com/ Kindof nice, actually. @Macrura it's another WP builder that seems to use blocks in a similar manner to Yootheme Pro and is UIkit friendly. But within the ecosystem of this setup and its open source friends are two interesting repos for general use. https://github.com/master3-blank-template/UIkit-Ex this repo refactors the uk-width component to allow up to 30 divisions of granularity. AND it adds uk-push and uk-pull back in! https://github.com/badabingbreda/uikit-css-grid this repo adds a whole new set of classes for cssgrid support! It is in SCSS but I will likely port it over to LESS if possible. You just need to remove any uk-padding from divs in the columns as they use gap instead. The CSS grid template/areas section takes a little bit of playing with to understand, but it allows for some breakpoint driven grid layouts that are simply not possible with vanilla UIkit 3. Especially if you opt for a 12 column CSS Grid layout. I've only started playing around with them this evening but so far, so good.
    1 point
  9. Ah I think I may have to spring for this course - Chris Coyier reposted a link to this guy's css grid and flexbox overviews and they are just so good. https://www.joshwcomeau.com/css/interactive-guide-to-grid/ https://www.joshwcomeau.com/css/interactive-guide-to-flexbox/ all part of https://css-for-js.dev/ Even though I've used them for awhile I can't say I've had as good an understanding as these overviews present.
    1 point
  10. No worries ?. I didn't for once consider it that way ?. Everything you said was spot on and constructive. I am just frustrated at myself that I have not been able to bring the docs to a reasonable standard (yet). I take your point and will consider this. My plan has been to make short (5 minutes maximum) video. Thanks.
    1 point
  11. This seems to work: $items = $page->repeaterfield->sort('title', SORT_NATURAL | SORT_FLAG_CASE); Got this from Example #2 on PHPs sort() manpage. So in essence, you where right @da² – i just had to add SORT_FLAG_CASE. (Until today, i didn't even know that these PHP constants exists. Lesson learned ? Thank you!
    1 point
  12. Be careful with $page->meta(), I'm using it for another purpose and it throws if page doesn't exist in DB, so at first page save (after giving a title): ProcessPageAdd: WireDataDB sourceID must be greater than 0 It's necessary to check ID before: if ($page->id) $page->meta(....);
    1 point
  13. Hello @fox_digitalanimals A solution with a hook and CSS. First, in site/templates/admin.php, define a new CSS to include in admin: /** @var Config $config */ $config->styles->add($config->urls->templates . "styles/test.css"); require($config->paths->core . "admin.php"); // this is already in admin.php, just take care of having it at bottom site/templates/styles/test.css: .foobar .InputfieldRepeaterAddItem { display: none; } And add a hook in site/templates/admin.php to hide "add" button by adding a css class to repeater wrapper div: $this->addHookAfter("ProcessPageEdit::buildFormContent", function (HookEvent $event) { /** @var Page $page */ $page = $event->object->getPage(); if ($page->template->name == 'myTemplate') { // Filter on this template /** @var InputfieldWrapper $wrapper */ $wrapper = $event->return; /** @var InputfieldRepeater $myRepeater */ $myRepeater = $wrapper->get('repeat'); // "repeat" is the field name of my repeater $myRepeater->addClass('wrap:foobar'); } }); You can finally add a condition on $user roles to add the css class: if ($user->hasRole("theRole")){ // add the css... }
    1 point
  14. TL:DR I've updated a PW page we've built 9 years ago for the first time and it's still a solid experience. Backstory Back in May I was on a crowded train somewhere in the middle of Germany. Now working as a "Consultant" who builds slidedecks instead of websites, I happily noticed the men next to me talking about responsive webdesign with his friend. During the obligatory "This train is late" announcement we started to chat. My seatmate, a geography teacher, recently attended a web workshop at a large Hamburg agency. He told me he now understands the value of a CMS for updating their site and he wonders how to build a responsive layout. They don't get paid for this and work on their homepage in their spare time. And they have a Typo3 installation ? Back in 2013, together with my friend Marvin, we've rebuild our school website with ProcessWire optimized for mobile devices. Launched in 2014 this was quite an impressive feat including online time tables, a working event calendar (with import feature) and many small nice touches. After my encounter on the train, I checked the page and yes, It's still online and updated daily! The next day I wrote my old teacher a short email if we should have a closer look into the underlying tech and within minutes I got a super happy reply that he is so glad that somebody would help (again). So let's dive into what we've done. Situation First some details about this ProcessWire installation that is updated by a few teacher on a regular basis. Over the 9 years they've wrote nearly 900 news articles and kept more than 250 pages up to date. The asset folder is over 11GB. Build with Processwire 2.4 (?) and lots of janky code we've updated the page once to 3.0.15 somewhere in 2016 quick and dirty. They even used the old admin layout. ProCache, CroppableImages3 and a few other plugins were used. Every single one of them required an update It's used the classical append-template approach with a single big "function.php" included file. It's running on PHP 5.6 and for whatever reason no PHP update was enforced by the hoster (But the admin panel screamed at me) A privacy nightmare: Google fonts embedded directly, no cookie banner and a no longer working Google Analytics tag included The old ProcessDatabaseModule made a database backup every week as planned over all these years. Nice. No hacks, no attacks and all teachers are using their own account with assigned permissions Changelog I've updated the page with a focus on making it stable and reliable for the next 9 years. After making a development copy of the page, I've started working on the following changes: Updated ProcessWire and all modules to the latest stable version. After reloading a few times, no errors encountered Updated the whole templates to make it work with PHP 8.2 Removed all externally hosted scripts, disabled cookies for all regular visitors and introduced a 2-click-solution for external content Reworked a few frontend style issues around the responsive layout, made slight visual changes for 2023 (e.g. no double black and white 1px borders) Ported the image gallery feature to more templates (Big wish of the people updating the site, they've used a workaround) Cleaned up folder and structures, removed a few smaller plugins and admin helpers no longer needed All this was done back in May and - with a big break - completed now in October. It took a few days and most of the time was spent figuring out our old code. Learnings ProcessWire is robust as f*ck. I just clicked "Update" and it mostly worked instantly I nearly removed features for the PHP update. A custom written importer for the proprietary XML schedule was hard to debug and understand (5-dimensional-arrays...). Gladly I've tossed a coin and just gave ChatGPT the php function source and error message and within a single iteration it updated the code for PHP8. The "responsive" CSS framework aged badly. The used 960gs skeleton uses fixed widths for the responsive layout. I couldn't get it be wider than 320px on mobile screens. So the site is responsive but with a slim profile for now. Replacing it would be a complete layout rewrite Result and looking forward The Werkgymnasium site is now updated and live again. It still loads superfast and looks great after all these years. We have a few more features planned to help our editors input new content but overall it just works. Looking forward a few issues remain. ProCache would require the paid update but it still works fine. The layout needs improvement on mobile screens. There is still an error with the pagination. We'll cleanup the code more and then make the whole template public on Github so that maybe a few students after us can continue with the updates. Maybe even rebuild the frontend one day. I hope I can give you an update in a few years again. As a closing note: I'm still grateful for the amazing community here and all the features ProcessWire has to offer. My daily work no longer resolves around websites but PW has a permanent spot in my heart. Thanks Ryan and all the contributors.
    1 point
×
×
  • Create New...