-
Posts
6,266 -
Joined
-
Last visited
-
Days Won
314
Everything posted by bernhard
-
I've recently bought a new Mac and had to setup ddev on my own the very first time ? Everything went smoothly, but I switched from docker desktop to colima as recommended in the docs and have one tip I want to share: Colima is more lightweight than docker desktop but has one drawback, which - with my idea - is actually now also a benefit in my opinion ? The problem is that there is no easy way to start colima automatically on startup. There are options but I found them a little complicated (maybe because I'm a mac noob). My solution is very simple: I've just added "colima start" to my ddev alias that I use to start any ddev project anyhow. So there's no extra steps needed and if colima is already running, that I just get a message that it is already running. Nice. That also has the benefit that I start colima only when I need it and otherwise it will not need any resources. Here are the aliases that I'm using: # ddev aliases alias ddc='ddev config --php-version "8.1" --webserver-type "apache-fpm"' alias ddcm='ddev config --php-version "8.1" --database "mysql:8.0" --webserver-type "apache-fpm"' alias dds='ddev ssh' #alias dd='ddev start && ddev launch && ddev auth ssh -d ~/.ssh/ddev' alias dd='colima start && ddev start && ddev launch && ddev auth ssh' alias ddm='ddev launch -m' # launch mailhog alias ddp='ddev poweroff'
-
Have you thought of doing it with url segments? /companies --> list all companies, maybe with pagination /companies/page1 /companies/page2 /companies/a --> list all companies starting with "A"... /companies/a/page1 /companies/a/page2 /companies/b --> "B"... and so on Not sure if the overall listing would then be necessary at all. Also I'm not sure what that would mean in terms of duplicate content - maybe we have SEO experts here that can tell us something about that? But I think from a logical point of view it's not possible (or not wise) to try to show companies with a special letter in the non-letterised company-listing (like /companies/page6#m) as that could also mean that you have 99 entries of companies with N and only one entry with M. You wouldn't have this problem when using url segments like /companies/m
-
This will be great for everybody using RockFrontend + LATTE. Thank you for your work and that update!! ? But there is still a small step missing/not working. I've added the explanation to the issue with screenshots demonstrating the problem. Would be great if you could take a look at that @ryan so that we can not only tick that request as completed but we can also actually use it to directly translate LATTE files in ProcessWire and we don't need the workaround any more ?
-
Free tier email service for (very) occasional emails
bernhard replied to joe_g's topic in General Support
Not sure, I don't think so. I've added an example how to send emails to the readme. The only thing you need is a template id. The template must be created at mailersend - but the benefit is that the client can do that and you don't have to develop something on your own. Not sure if it's possible to add attachments to mails though. -
Notice from ready.php: Trying to get property of non object
bernhard replied to esspea's topic in Getting Started
It would likely help if you share the code/hook in question, if that's possible ? -
I have a new laptop. New laptop, new life. New life, new signature ? I thought it should be easy to find some kind of mail signature generator to quickly create one, but I was wrong. Many require registration (once you finished creating the signature - thanks for wasting my time...) or a pro account for the nicer layouts. How do you handle that topic? Keep signatures as simple text? Or do you have any recommendations for free generators? Thx ?
-
v3.0.0 introduces a breaking change as of request from @gebeer Unfortunately I have chosen a bad order of parameters on the createPage() method that showed warnings for @gebeer (where did that warnings appear?) That's why I decided to change the order and the recommended way to use the createPage() method is now using named arguments. RockMigrations had PHP8.0 requirement anyhow so we can rely on them! $rm->createPage( template: 'foo', parent: 1, title: 'My foo page' ); That's a lot better to read so I think despite the breaking change it is a worthwhile addition. PS: I tried my best to make that breaking change as obvious as possible including the version bump to 3.0.0 and the note about the breaking change in the release log. If anybody has suggestions on improvements please let me know!
-
How to add own tab in Admin on edit page via API?
bernhard replied to dotnetic's topic in API & Templates
I don't think so, what is your exact question? ? Nowadays I'd do it like this: The only think that I'd do differently is to make that PageClass use the MagicPage trait instead of manually triggering the init method in init.php -
I'm always looking at this number:
-
Great to hear that @rastographics ? I think every second invested in getting DDEV to run properly is well worth it! I could not be happier with my dev setup and I hope you will be too ? Just curious: What does that mean in ms per pageload in the tracy debug bar?
-
Thx for updating the code! Nothing wrong with it, but this would also work and is a little shorter ? $kontrolleur = $input->post('kontrolleur', 'text');
-
Well, the whole concept of storing data in PW and Pages vs. DB-Tables is the same. RockGrid just helps you to present that data in a tabular way with client side sorting and filtering. But the data needs to be present in pages. ?
-
Would be nice to know how old that site is ?
-
1 second is really too slow in my opinion. I can't remember exactly, but when I was on windows back then I'm quite sure the load times have been instant (around 100ms)... Did you see this video? From what I can see it's blazing fast on Windows + WSL2! Even with Typo3 (https://youtu.be/ZMfHaUkhfc0?t=1881)
-
I'd not call it more professional. It's just different how you usually do such things in ProcessWire. In common PHP frameworks you'll mostly have the same setup: Database tables and PHP + mysql queries. In ProcessWire this is totally different: You have Pages + the PW API. The PW way has a lot of benefits, for example: You don't have to build a GUI - you get the PW Backend for free You don't need to write plain SQL - you have the PW API for reading/writing data which is usually a lot easier and also more secure In your example instead of having a DB table "rundgang" with columns "person, wasser, start, ende" you'd add a PW template called "rundgang" and add fields "person, wasser, start, ende" to that template. To add records to your system instead of doing "INSERT INTO ..." you do this: <?php namespace ProcessWire; $p = new Page(); $p->template = 'rundgang'; $p->parent = 1234; // your parent page id $p->person = $pages->get("template=person,name=bernhard"); $p->start = "2023-01-05 20:00"; $p->ende = "2023-01-05 21:30"; $p->save(); And to output entries on the frontend instead of doing "SELECT ... FROM ..." you'd do something like this: <?php namespace ProcessWire; $start = strtotime("2023-01-01 00:00"); $end = strtotime("2023-02-01 00:00"); foreach($pages->find("template=rundgang, person=123, start>=$start, ende<$end") as $p) { echo "Rundgang: {$p->person->title} von {$p->start} bis {$p->ende}<br>"; } To create a custom endpoint for your App have a read about URL Hooks and Bootstrapping PW.
-
This could also be an interesting read for you: https://processwire.com/talk/topic/26792-headless-processwire-how-do-you-do-it/
-
Ah, didn't look there! Nice to have for sure!
-
Yes: This is the syntax that works for RockMigrations ?
-
Hey @adrian could the request info panel please also show the page's pageClass? Or is that information somewhere else? See here, where it's a quite essential information that the current page is of type "\RockCRM\Invoice", which is obvious in the dump but not in the request info panel: Thx in advance!
-
The system doesn't know that. You need to add a language switcher to your frontend so that the user can decide: https://processwire.com/talk/topic/12243-language-switcher-on-front-end/ There's also a module to auto-detect the user's language, but I've never used it: https://processwire.com/talk/topic/8733-autodetect-language/
-
Thx @Jozsef here you go: https://github.com/baumrock/TextformatterRockDown#usage ?
-
@olafgleba Thx for the explanation, I understand now. And as far as I understand hooking Session:loginSuccess is not 100% sufficient. What if a user is already logged in when you add the hook? I think the user will not get redirected in that case and will still be able to work in the backend. Maybe hooking before Page::render would be better and if the user is not a superuser redirect him/her somewhere else: $wire->addHookBefore("Page::render", function (HookEvent $event) { $page = $event->object; if ($this->wire->user->isSuperuser()) return; if ($page->template != 'admin') return; $this->wire->session->redirect('/maintenance'); });