-
Posts
405 -
Joined
-
Last visited
-
Days Won
5
Everything posted by da²
-
One important thing to add: when exporting your pages, don't forget to disable output formatting before to read properties on pages: $myPage->of(false); So you're reading data as it was entered in database, without applying formatter defined in admin on this field. And when importing data, an easy optimization is to use database transaction: try { wire()->database->beginTransaction(); // Import data (creating and updating pages) wire()->database->commit(); } catch (Exception|WireException $e) { wire()->database->rollBack(); } For 100 pages, you won't really need optimization.
-
Hello, I would use PW pages with a "practitioner" template. Data export won't be more complicated, you can use PW API for that. If it needs to be optimized you can use several options like $pages->findMany(), findJoin(), findRaw() or even use raw MySQL query. That way your practitioners are already editable from admin without effort. Also check custom page classes if you need to attach your own class to this practitioners pages. It depends on your actual knowledge on PW, PW has a good documentation, you can start by looking Pages and Page. First one is useful to find your practitioners pages, second one to access a single page or create a new one.
-
log in via Google to Google-account AND PW-user-account
da² replied to froot's topic in General Support
Hello, I'm not sure if you really need a module for that, it looks simple enough to implement: https://developers.google.com/identity/sign-in/web/sign-in Searching for an existing user or creating a new user is just a bit of code, so personally I would go without any module. -
need-guidance [Beginner] htacces not being read by apache
da² replied to Kitch's topic in General Support
Hello, Yes I think this is enough. Other way is to change it only for this web site, in your apache site configuration if you have created one (/etc/apache2/sites-available/). This is a good idea to do this yourself, I like it too, with a bit of practice and google searches you'll know how to configure a web environment by yourself, modifying apache config, enabling/disabling a site, setting up php, php-fpm, etc. This is also useful when setting up environments under Windows. ? But Ubuntu is useless on a server, it takes a lot of memory for nothing. Usually we only need Debian and a SSH console (or several consoles for multi-tasking), and this is often faster than using a desktop. ? -
Re-thinking ProcessWire Admin system (thought experiment)
da² replied to Jonathan Lahijani's topic in Dev Talk
Hello, Angular may be a possibility. But it would be a full admin replacement, not just modifying the existing. -
Hello, reading official site I see "AlmaLinux OS is an open-source, community-driven Linux operating system that fills the gap left by the discontinuation of the CentOS Linux stable release.", so if your are fine with CentOs you shouldn't have any problem. Linux distribution choice is not related with ProcessWire, as soon as you have a web server, a database and Php you can run PW.
-
Hello, since a recent version, and because strftime has been deprecated in PHP 8.1, month and day names must be translated in PW admin, in file /wire/core/WireDateTime.php. Then you don't need to format date by yourself, it will be formatted according to field configuration.
-
JetBrains also added to PhpStorm (and other products) an AI assistant based on ChatGPT, I didn't try it yet.
-
Be sure that the variable is defined before the loop.
-
Hello, I would probably use an absolute positioning for the drop-down, so it works fine on all screens. Pushing the content following this box doesn't look like the good choice to me. And on mobile there probably are screen sizes where you won't be able to see photo and description at the same time.
-
Looks like your foreach is wrong, there's not even a "{" or ":" in the opening and I don't see end of loop. ? Could you use the same syntax as in my message? <?php foreach($countymatch as $match): ?> <?php endforeach; ?>
-
Yes, and replying to a topic doesn't register you to this topic, you always need to register manually. ?
-
You should show the code that's working with a list.
-
Hello, If you want a free module for user registration you can use LoginRegister. There's features to validate emails, manage forgotten passwords and more. For the notifications you can add a checkbox on user template "registered to notifications", and check it when user wants notifications, so later you can find them with $users->find('registeredToNotifications=1'). To build forms for free you can use module InputfieldForm, for example for the form to register to notifications. To send mails you can use PHP mail function, if your server is well configured to send mails.
-
No hook involved (disabled all just in case). You're talking about the page setup/template/edit?id=2 (admin page template)? No I didn't defined a sort field. Field are sorted alphabetically in main menu, but not in fields page. I'm also not using tags, in case they change sort order. I can't even understand what is the sort order, as none of the columns is sorted. ?
-
Hello, I don't know if I changed a parameter somewhere to do that, but fields are never sorted by name. I click "Name" column, but as soon as I change page and come back here it's again sorted in a way I don't understand. Filter options are set to "Show all". How to make this page default sort by name?
-
Twig also is compiled to PHP, it's PHP code that interprets your method/property calls and fails on some PW properties for an obscure reason. Reading your link, the first talk is about this sh*t Twig interpretation. ? So at least this ugly behavior is not part of Latte. ? EDIT : Haha, and just now I'm searching something in my IDE and see an old Twig error log, showing how WIIIIIIIDE is this Twig interpretation:
-
Hello, Maybe I will consider using Latte in the future. I love Twig but I have 2 problems with it: This two issues I'm reporting on this page, the second one is the worse because you can write a working code that will break in the future because a field value has became blank. I could use object.get('prop') everywhere but that's ugly and boring to type. The fact that it tries to interpret your property/method calls (maybe it can be disabled, I never searched), for example if I write object.method() and it's not found, it will also try object.getMethod(), object.method, and so on... So you can let typo in your code without knowing it if Twig found something else. On my custom page classes I can have a property prop (the PW field) AND a method getProp() (my own function that does more than prop) and they are not interchangeable even if they return same type of value. Could you tell me if Latte is doing the same 2 things? In terms of performance I didn't find benchmarks with latest version of both engines but I suppose they are close. I'm not sure yet what I'll use in my next project, I'm also interested exploring my own full-PHP method to get the best performances but that must be a clean solution, easy to read/update/reuse.
-
On my previous project, a designer created a template on https://www.figma.com/. You can export design to CSS, I add a look at this code and it's a terrible thing. ? For example, this simple box... ...generates this mess: /* Frame 232 */ position: absolute; width: 460px; height: 580px; left: 490px; top: 425px; /* Ombre */ box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5); /* Offre Gratuite */ position: absolute; width: 460px; height: 580px; left: 0px; top: 0px; /* Ombre */ box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.5); /* Rectangle 6 */ position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; /* Blanc */ background: #FFFFFF; border-radius: 10px; /* Pour accéder à notre outil, veuillez vous identifier */ position: absolute; height: 171px; left: 108px; right: 108px; top: 86px; /* Desktop - Texte courant */ font-family: 'Roboto'; font-style: normal; font-weight: 400; font-size: 18px; line-height: 21px; display: flex; align-items: center; text-align: center; /* Bleu foncé */ color: #02171C; /* Titre */ position: absolute; height: 86px; left: 0px; right: 0px; top: 0px; /* Rouge */ background: #E74342; border-radius: 10px 10px 0px 0px; /* J’ai déjà un compte */ position: absolute; height: 26px; left: 0px; right: 0px; top: 30px; /* Desktop - Mise en exergue */ font-family: 'Roboto'; font-style: normal; font-weight: 700; font-size: 22px; line-height: 26px; /* identical to box height */ display: flex; align-items: center; text-align: center; /* Blanc */ color: #FFFFFF; /* Bouton */ position: absolute; height: 55px; left: 0px; right: 0px; top: 485px; /* Frame 3 */ /* Auto layout */ display: flex; flex-direction: row; align-items: flex-start; padding: 15px 23px; gap: 10px; position: absolute; left: 23.48%; right: 23.48%; top: 0%; bottom: 0%; /* Rouge */ background: #E74342; border-radius: 30px; /* Se connecter */ width: 198px; height: 25px; font-family: 'Gilroy-Bold'; font-size: 20px; line-height: 23px; display: flex; align-items: center; text-align: center; /* Blanc */ color: #FFFFFF; /* Inside auto layout */ flex: none; order: 0; flex-grow: 0; /* Group 202 */ position: absolute; width: 380px; height: 85px; left: 40px; top: 230px; /* Identifiant * */ position: absolute; width: 380px; height: 30px; left: 40px; top: 230px; /* Desktop - Texte courant bold */ font-family: 'Roboto'; font-style: normal; font-weight: 700; font-size: 18px; line-height: 21px; /* Bleu foncé */ color: #02171C; /* Frame 3 */ box-sizing: border-box; position: absolute; height: 55px; left: 8.7%; right: 8.7%; top: 260px; /* Blanc */ background: #FFFFFF; /* Gris */ border: 1px solid #5E7F8C; border-radius: 30px; /* Votre identifiant */ position: absolute; height: 21px; left: 30px; right: 59px; top: 17px; /* Desktop - Texte courant */ font-family: 'Roboto'; font-style: normal; font-weight: 400; font-size: 18px; line-height: 21px; /* identical to box height */ display: flex; align-items: center; /* Gris */ color: #5E7F8C; /* Group 203 */ position: absolute; width: 380px; height: 85px; left: 40px; top: 335px; /* Mot de passe * */ position: absolute; width: 380px; height: 30px; left: 40px; top: 335px; /* Desktop - Texte courant bold */ font-family: 'Roboto'; font-style: normal; font-weight: 700; font-size: 18px; line-height: 21px; /* Bleu foncé */ color: #02171C; /* Frame 3 */ box-sizing: border-box; position: absolute; height: 55px; left: 8.7%; right: 8.7%; top: 365px; /* Blanc */ background: #FFFFFF; /* Gris */ border: 1px solid #5E7F8C; border-radius: 30px; /* Votre identifiant */ position: absolute; height: 21px; left: 30px; right: 59px; top: 17px; /* Desktop - Texte courant */ font-family: 'Roboto'; font-style: normal; font-weight: 400; font-size: 18px; line-height: 21px; /* identical to box height */ display: flex; align-items: center; /* Gris */ color: #5E7F8C; /* Mot de passe oublié ? */ position: absolute; width: 380px; height: 30px; left: 40px; top: 440px; /* Desktop - Texte courant bold */ font-family: 'Roboto'; font-style: normal; font-weight: 700; font-size: 18px; line-height: 21px; /* Rouge */ color: #E74342; Everything is absolute, font-family and other attributes are duplicated everywhere... There's almost nothing to keep in the final code. I wouldn't trust an AI generated code, and when you need to make changes you first have to learn what the AI created and to adapt to it, not my taste. I prefer to have full control on this and know what I'm doing.
-
It depends on your needs.
-
I don't know Swift but I see it's a language to develop Apple applications. At first instance I don't feel this is related with using static method in PHP, as it looks related with Python and multi-threading. ? EDIT: Just in case @donatas, are you using php-fpm? Because PHP error log could be in another location and not in Apache.
-
There's always an error message recorded somewhere, if not in PW logs it's probably in web server logs. If @donatas is using Xampp on Windows, Apache logs are in xampp/apache/logs/error.log. Trying to understand an error without knowing the message is quite challenging. ? EDIT : But he should first look in PW Exception|Error logs.