Leaderboard
Popular Content
Showing content with the highest reputation on 07/06/2022 in all areas
-
If you're looking for a JS library that pairs well with Tailwind, might I recommend Preline, which I just found on Hacker News: https://preline.co/ Another option includes Flowbite, but at the time of this writing, Preline's JS goes a bit further and has more components and more options (such as offcanvas, mega menu): https://flowbite.com/ There's also Alpine Components if you're into Alpine, however it's commercial: https://alpinejs.dev/components I like Alpine.js, but the "locality of behavior" approach it takes for these common components is not my style. I do use it elsewhere however. - Lastly, there's Headless UI, but that probably won't fit with a typical ProcessWire frontend unless you are using React or Vue: https://headlessui.com/ I wish Headless UI had a Alpine.js version, but the author of Tailwind ultimately scrapped the idea (it was mentioned in a Tweet thread somewhere). This would have been my go-to approach, assuming it was comprehensive enough. But there's many options as stated above.3 points
-
Yes, that's quite easy and something that I need all the time: <?php // site/ready.php $wire->addHookAfter("Pages::saveReady", function(HookEvent $event) { $page = $event->arguments(0); // only rename pages with template 'yourtemplate' if($page->template != 'yourtemplate') return; // only execute the hook when the page is created // otherwise the page name would be regenerated on every save if($page->id) return; // create a unique random pagename // see the methods docs for all available options $page->name = $event->wire->pages->names->uniqueRandomPageName(); }); I recommend to add notes to the backend to make it obvious what's going on and where: <?php // site/ready.php $wire->addHookAfter("ProcessPageEdit::buildForm", function(HookEvent $event) { $form = $event->return; $field = $form->get('_pw_page_name'); $field->collapsed = Inputfield::collapsedNoLocked; $field->notes = "Random page name is set via hook in ready.php"; });2 points
-
2 points
-
I build a lot of custom registration forms on ProcessWire sites and prefer to write the HTML directly, with some ProcessWire goodies added on. This seems quickest for authoring forms that match the site and doesn't require jQuery/jQueryUI. I prefer to make forms work even when JS is disabled, if possible. For CSRF, I manually generate a single-use token and put in the hidden form fields. I have a custom class that lets me set up a set of fields, their types, and validation rules. Parts of that leverage PW's $sanitizer and sanitized values end up in $input->whitelist() for easy processing and for populating form field values.1 point
-
Hey @kongondo the utility that grabs the average order value on the shop home isn't clear in what range it's working the value out over. I would guess if it's 0.32p in this case it's over a year but I would guess possible the title saying "Monthly Average Order Value" and calculating that would maybe be more useful on the dashboard. Just a thought mate. Didn't know if here was a good place to post this or not, so forgive me if this isn't the best place for this.1 point
-
Defo! <?php if ($order->paymentMethod == Invoice){ echo 'Mate, clock is ticking! :-)'; } Sorry I wasn't clear.1 point
-
I think it does... haha. So I can check with for instance: if ($order->paymentMethod == Invoice) Or no?1 point
-
Just tested it, I can add properties and dimensions, search is working fine. Padloper 0.0.2, version from 27 June PW 3.0.1841 point
-
Personally, I prefer the old-school way rather than the ProcessWire way simply because it becomes too cumbersome to use ProcessWire to create Admissions forms, Tax forms, Milspec forms, Aircraft maintenance forms, etc. which I do almost monthly. I did begin with the ProcessWire way and spent way too much time trying to get the layout correct on both the front end and back end, so I stopped using its forms. As you know PHP has some built-in validation such as email, url, dns, etc. The remaining form types are simple enough to validate manually (ie, not using ProcessWire). Don't get me wrong, ProcessWire is great for the majority of solutions I require and I use it as the base for all current projects. But Ryan built it to satisfy his requirements, which don't necessarily meet with our requirements 100% of the time. When I create complex forms I use css grid and flexbox with custom styles to achieve the necessary front-end layout -- I don't allow user access to any back-end forms. Custom javascript is sometimes required to validate some form elements client side, including ajax calls, but it is nothing major. Also, I don't have to bloat my forms by including one or more third-party javascript libraries. If I receive a request for a simple form such as a contact form, then yes, I use the ProcessWire way. Otherwise, I find it much simpler to do it the old-school manual way.1 point
-
Hi @alexm, This template file will receive $order as well as $orderLineItems, $orderCustomer and a bunch of other variables shown below: <?php namespace ProcessWire; /** @var WireData $order */ /** @var WireArray $orderLineItems */ /** @var float $orderSubtotal */ /** @var bool $isOrderGrandTotalComplete */ /** @var bool $isOrderConfirmed */ Payment info is in $order. We save the title of the payment method. You can use that by itself or use it to grab the payment gateway/method page itself (e.g. if you want the ID for some reason. Here's an example: <?php namespace ProcessWire; // COMPLETED ORDER /** @var WireData $order */ bd($order, __METHOD__ . ': $order at line #' . __LINE__); // PAYMENT GATEWAY/METHOD TITLE /** @var string $order->paymentMethod */ bd($order->paymentMethod, __METHOD__ . ': $order->paymentMethod at line #' . __LINE__); # OR ALIAS /** @var string $order->payment */ bd($order->payment, __METHOD__ . ': $order->payment at line #' . __LINE__); /** @var string $paymentGatewayTitle */ $paymentGatewayTitle = $order->payment; /// GET ID OF PAYMENT GATEWAY/METHOD /** @var int $paymentGatewayPageID */ $paymentGatewayPageID = (int)$padloper->getRaw("template=payment-provider,title={$paymentGatewayTitle}", 'id'); bd($paymentGatewayTitle, __METHOD__ . ': $paymentGatewayTitle at line #' . __LINE__); bd($paymentGatewayPageID, __METHOD__ . ': $paymentGatewayPageID at line #' . __LINE__); // IN CASE YOU WANT THE PAGE ITSELF FOR SOME REASON /** @var Page $paymentGatewayPage */ $paymentGatewayPage = $padloper->get("template=payment-provider,title={$paymentGatewayTitle}"); bd($paymentGatewayPage, __METHOD__ . ': $paymentGatewayPage at line #' . __LINE__); Hope this helps.1 point
-
ProcessWire's core comes with a lot of helpful debugging tools and capabilities built-in. In this post we'll cover some of these useful tools and how to use them— https://processwire.com/blog/posts/debugging-tools-built-in/1 point
-
Shame on me - and in good old german: Wer lesen kann ist im Vorteil ? So this can be closed! Thanks!1 point
-
Megapixel is Not the Filesize ? It defines how many pixels an image has 2 Megapixel = 2.000.000 Pixel = approx 1731*1155 (= 1.999.305 Pixel)1 point
-
I think it‘s the „Maximum Megapixel“ Configuration ? it‘s set to 2MP, it‘s too low for your Image ?1 point
-
Hi @wbmnfktr Welcome to the TailwindCSS party. It is fun and the new always JIT and standalone CLI is awesome. Gideon1 point
-
More than a year ago I said I would try TailwindCSS... now it finally happened and... and the result is disastrous! Well... disastrous for my opinion back then and my thoughts about it until a few weeks back. I am quite surprised and happy with the result, to be honest. I did a rebuild of an ongoing side-project, with a full rebuild of the whole site structure all the way through to any breakpoints (CSS only, HTML was kept except additional classes). Yet some parts are still outside of TailwindCSS as those are really custom and are way better placed in an additional CSS file. Even though you can customize TailwindCSS to almost all of your needs but I didn't want to bother with it for now. The change in file size is quite dramatic... or even super awesome. However you want to see it. I went from... 59kb (the whole project) down to 17kb (structure - based on TailwindCSS CLI generated .css file) PLUS 5kb custom CSS for colors, custom properties PLUS 10kb custom CSS for icons, backgrounds, and fonts PLUS unknown size of additional kb within HTML due to those TailwindCSS classes Ignore those other files as those are helpers or part of other instances within that setup. Which is in total: 32kb for the full project, all pages, all icons, all fonts. Yet... the whole setup isn't ready for production right now as my setup only really works with 11ty as a middle-man for now and not within my PW workflows... but that's another story. There are probably even more things I could optimise in terms of fonts, icons and custom classes for colors. But for now... WOW... I always was against those utility frameworks and didn't like them at all. I am and always was a VanillaCSS Purist... didn't ever really like Bootstrap, UIKIT or anything like that, but TailwindCSS could and might have changed my mind. From now on... I might have to think and work different for some or another reason. Right now my test was built on a project I really knew in and out with all its details. Let's see how it works out in a real and new project. Results based on: TailwindCSS 3.1.2 (latest - as of now, 2022-06-14. all file sizes unzipped, without plugins like Typography)1 point
-
This thread is for me to announce Padloper releases (until I find a better way to do it). Please use your download link (sent to your email) to get the latest Padloper version. Please don't post your bug reports on this thread. Instead, create a new thread for that in this support forum. Thanks. Releases Release Sunday 12 June 2022: Padloper 002 Features Add Import API (currently for product-related imports only). This allows you to import items (attributes, categories, products, generate variants from scratch, etc) into your padloper shop. Please see the Import API documentation. Rest of the World Shipping Zone is now fully functional. Configurable dynamically loaded product variants. This is useful for cases where a product contains lots of variants. Editing such a product will slow down the browser considerable as all children pages (variants) will be loaded as well. Bug Fixes Please see the bug fixes prior to today's release date referenced in the bugs and fixes thread. --- Release Thursday 14 July 2022: Padloper 003 Features Add Addons Feature. This allows you to extend the functionality of your shop by developing, adding and activating addons (mini apps). The forum announcement about this feature is here. Please see the Addons documentation and the related Addons API documentation. A short demo of the feature is available here. Bug Fixes Please see the bug fixes for today's release date referenced in the bugs and fixes thread. Release Sunday 24 July 2022: Padloper 004 Features Update FieldtypePadloperOrder schema to include details about selected shipping rate name and delivery times. Amend single order view GUI to show order shipping rate name and delivery times. See the request details here. Make a number of methods hookable - for extra validation of custom form inputs and custom determination of whether to apply EU digital goods tax. See the request details here. Release Tuesday 30 August 2022: Padloper 005 Features Amend inventory GUI to allow non-editing of locked variants (similar to products without variants). Bug Fixes Please see the bug fixes for today's release date referenced in the bugs and fixes thread. Release Friday 23 September 2022: Padloper 006 Features Make PadloperProcessOrder::getOrderCustomer hookable. This has various uses, e.g. allows to initially pre-fill customer details to the order checkout form during order confirmation. Can be used, for instance, in conjunction with LoginRegister module. See the request details here. Demo code is available here. Bug Fixes Please see the bug fixes for today's release date referenced in the bugs and fixes thread. Release Tuesday 27 September 2022: Padloper 007 Features/Enhancements Don' t show product properties settings in General Settings > Standards Tab if product property feature was not installed. Bug Fixes Please see the bug fixes for today's release date referenced in the bugs and fixes thread. Release Sunday 08 January 2023: Padloper 008 Features/Enhancements Fix bugs related to the demo starter projects. Bug Fixes Please see the bug fixes for today's release referenced in the bugs and fixes thread. Release Sunday 05 May 2024: Padloper 009 Features/Enhancements Please see the dedicated thread here. Bug Fixes Please see the bug fixes for today's release referenced in the bugs and fixes thread.1 point
-
1 point
-
You need to get $inputfieldTextTags from the field itself: $inputfield = $page->getInputfield('tags_field'); $list = $inputfield->getTagsList(true); foreach($list as $item){ // echo tags ? }1 point
-
I have been following tailwind css for a while. Can't help it but having so many classes in a tag really clutters up your html. What has become wrong with vanilla css ?1 point