Leaderboard
Popular Content
Showing content with the highest reputation on 06/07/2022 in all areas
-
Hi, I know quite a few of us are working on multi-language websites and are most likely using the `strftime`, however it's deprecated as of 8.1.0 and set to be removed in 9.0. There's some time left but on my local environment using MAMP and 8.0.8, it's as if it's already gone as dates were not localized anymore. Looking for options, I came accross this which might be useful to others: https://gist.github.com/bohwaz/42fc223031e2b2dd2585aab159a20f30 What's your take on this ? Also I wonder how things will be handled in PW's core as the WireDateTime is using that function as well.2 points
-
@bernhard I am getting back to you about this. I had the code not working when I tried it before releasing it, and finally the reason is that before this post, I given a try to get the SSR feature working with Svelte and Inertia. Still no luck, it's not really an issue, but we are screwed at this moment if the app require SEO, but again, I am just speaking about >Svelte<. Nevertheless, SSR works if you like Vue or React, or only JS. Another thing, if some people are also interested, I could share a CI/CD WIP setup for ProcessWire, started after the thread made by @wbmnfktr and the comment of @lokomotivan . Actually fully based on gitpod opensource doc site, taken to build this setup, where a contrario, SSR feature is working for Svelte.2 points
-
Hello @Thromisios First, I would refer you to the ProcessWire documentation - https://processwire.com/docs/start/ And then, look through the sections of the forum: https://processwire.com/talk/forum/8-getting-started/ https://processwire.com/talk/forum/13-tutorials/ https://processwire.com/talk/forum/6-faqs/ Next, I would look at the sections of the forum and documentation that raise more questions for me. And of course https://www.php.net/ when you don't understand how PHP works. Good luck with your adventures.2 points
-
Not sure why that is. Seems strange considering that system fields can be added by users in the Columns tab. You can use a hook to set the columns and default sort: $wire->addHookBefore('ProcessPageLister::execute', function(HookEvent $event) { /* @var ProcessPageLister $lister */ $lister = $event->object; // Only for Users lister if($lister->parent->id !== 29) return; // Include "created" in default columns $lister->columns = [ 'name', 'email', 'roles', 'created', ]; // Set default sort $lister->defaultSort = '-created'; // Optional: allow user to change sort but reset to default sort each time Access > Users is visited if(!$event->wire()->config->ajax) $lister->sessionSet('sort', ''); });2 points
-
TextformatterEmoji converts named shortcode emojis in ProcessWire text or textarea fields to the corresponding UTF-8 emoji character. For instance :smile: converts to: ? This can be especially useful if your ProcessWire uses the utf8 character set rather than utf8mb4 as it enables you to use emojis on an installation that typically would not be able to save them. This is because emojis usually require utf8mb4 (4 bytes characters) to be used by the database in order to store them. Note that how the emoji appears (and sometimes whether it appears) can vary from platform to platform, and from browser to browser. Here is an alphabetical list of supported emojis and the shortcodes you can use to show them in your text. If you want to add any emojis that are not already present you can do so in the emojis.json file.1 point
-
@kongondo sorry to bother with another bug report. On product-details i can not add properties in latest version. The search just wont start (i also see no activity in networks-tab in case it is ajax, the console also does not contain any js-errors) The properties and dimensions are created and published.1 point
-
Yes, I used the "hidden field" feature of the forum to avoid a wall of text here in the thread. As you saw later, you can add more fields by following my comments, just a small note about the last portion of code (the input html markup), she is called in "Heredoc" and you can write inside it HTML code as you are used to and call basic PHP variable from there. If you encounter some issue, just think about the PHP version you are using and check the doc, as there is some subtilities since php 7.3; That's it, have fun ? When you say you prefer raw code over module, I think you are confusing a bit things. Modules are "raw code", for example, I think like other devs, I always end up writing my code in a module, then call a single method from the module to render the "module's context", which let focusing on the code of the template and not the logic behind, without speaking maintainability and dozens of other reasons. Be ready to receive more "RTFM ?" answer in the future ?1 point
-
By "standardised reusable groups of fields" I mean something like what's described in the Combo ProField. FieldsetPage works nice, or at least improves my current solution, which goes something like this: So basically I'm using a repeater, a block type selector and a bunch of fields (this screenshot is from my last project). The block type selector is a custom module I made based on FieldtypeSelectFile. I just added a way of assigning thumbnails to illustrate what php file you're selecting. This works pretty well, but something that's a pain in the ass is that I have to dump all fields that every content block may use in the same repeater, and then for each of them, make visibility depend on the block type's value. Also, I have to order the fields and use names that work on any block type that uses them, which becomes a bit of a puzzle sometimes. With the FieldsetPage, I at least have things more organised, and I can make adjustments like having fields sorted as it makes more sense for each content block, override titles and descriptions and whatnot. I'm liking this approach. On a first glance only the required fields are still a bit weird to set up, but it's a nice improvement from my previous solution.1 point
-
FieldsetPage fits that description and is part of the core: https://processwire.com/blog/posts/processwire-3.0.74-adds-new-fieldsetpage-field-type/1 point
-
You are calling information about all logs. What you need instead is described here: https://processwire.com/api/ref/wire-log/get-entries/ or https://processwire.com/api/ref/wire-log/get-lines/ In your case e.g.: <?php $myLogs = $logs->getLines("simplecontactform-log"); //do stuff with single lines (inside $myLogs array)..1 point
-
1 point
-
Hey folks, so in a project I'm working on there are 750+ news articles in WP that are image-heavy in recent years. WP has a habit of storing the original images full-size - well, ProcessWire does too but I always set max dimensions on the image fields to resize during upload to prevent 2mb+ images on my disk. This had resulted in an uploads folder some 25GB in size from 2003-2022. Disk space is, fortunately, cheap nowadays, however I soon realized after mulling it over with Ryan that the easiest and most sane option for importing all those articles was to scrape in the post content HTML into a PW CKEditor field (thanks SimpleHTMLDOM for making this so simple!) but leave the images alone - WP had already done resizes for various lightboxes and galleries so it was just the original, huge images I had to contend with. The solution - on my own copy of the WP uploads dir - was to run this command and watch it go: find ./ -type f \( -iname \*.jpg -o -iname \*.jpeg -o -iname \*.png \) -exec mogrify -quality 90 -verbose -resize 1600x1600\> {} \; It's basically searching all files and subfolders for .jpg, .jpeg and .png files and resizing to no more than 1600px landscape/portrait whilst preserving aspect ratio (no cropping) and 90% image quality. I chose those sizes as the various links in galleries and lightboxes were loading the original file, not one of the WP resized ones, so now we can be fairly sure that we're loading <500kb of image maximum instead of sometimes 10mb+ (some folks have really nice cameras ? ). I'm sure @horst can probably tell me if that command could be better. I think mogrify is usually for a batch of files for example, whereas the find command is serving them up individually so convert might be more appropriate than mogrify, but this command iterates through the files quickly and only resizes which ones it needs to and is happily chugging away right now so I'm happy with it. One thing to note is that any resizing can be a bit CPU-heavy, so if you have the chance to do this on a local server first or out of "normal" hours for site visitors then that's recommended as the server may slow down for the duration.1 point
-
Yeah that's the part that is missing and why I've not yet officially released it. I want to prepare better docs and an intro video to make it as easy to use as it can get. Any help in that direction is welcome, so if you try it please let me know all your questions, concerns etc ?1 point
-
To support my team I'm looking forward to find German support for Processwire projects. I would be happy to get in touch! Please DM me. Best regards Mats1 point
-
Hi flydev, thank you so much for your very, very kind and elaborated answer! I feel much better now ? of course, I've read all that, and more about the honeypot technique outside pw. But again, I still have the problem to implement. what is this? can't open Edit: found your very helpful remarks only recently, in the hidden content which I couldn't open at frist Does it mean, I can't just extend the form by duplicating the structure of the input fields, sanitizing them and put them in the mail call? Anyway, I will try Ryan's solution and come back to your kind help offer if I have problems. Thank you again so much for the time you have taken on this! I really really want to learn more processwire, that's why I'm trying to do it myself. Also, I prefer raw code over modules, because they give me the freedom. Maybe once I know more about how the code works, modules can make it faster. But for now, I want to learn ?.1 point
-
Don't get me wrong, but these hours would have been better spent on 74€ for a single licence of FormBuilder. No coding required. I own a DEV licence since 2016 and I never think twice about the yearly payment, not even a second! FormBuilder slogan should be: Forms made easy!1 point
-
By definition, a form isn't "simple" as it's not composed by a simple input that we could copy paste 13 times. A simple form is simple when you have someone have already done all the hard work. Technically speaking, even if the form has 1 field, or 13, you still need to follow some simple rules to handle the form or your future website will get hacked; And not because of the ProcessWire fault. All that to finally say, that the solution shown above are effective, and just require you to read the documentation to follow the implemenation that the author had in mind. Because they are smart and talented, they tackled the same problem you encounter and made their modules simple to use. You can also find some guides in the tutorials section of this forum, but I suggest you to buy without brainstorming the pro module made by Ryan if you are looking for a click / copy / paste solution. About the 12 years old code (which should works without hassle lol thats crazzy every time ?) you will find a lot of other working samples code to copy pasta, I still suggest you to read and understand what you are doing ? ?1 point
-
By default, ProcessWire will prevent you from running subcruberList.php like that (you will get error 404 or 403). What you can do is create a ProcessWire template and set subcriberList.php as its template file. Then create a page with that template and do your POST request to that page. There are a couple of threads in the forums about handling forms that may be of help. Also consider using a form module such as FormBuilder.1 point