Jump to content

bernhard

Members
  • Posts

    6,284
  • Joined

  • Last visited

  • Days Won

    316

Everything posted by bernhard

  1. Sounds like a nice module πŸ™‚ Just a FYI there is also https://processwire.com/store/pro-dev-tools/wire-request-blocker/ which blocks unwanted requests efficiently via .htaccess πŸ™‚
  2. To be honest I'm not 100% happy with this feature either, but it is used on all of my websites and that would mean a lot of refactoring. There are several reasons why I built it like this (for example I advertised the module as "zero setup", so it needs to work without prior hunting through docs and adding scripts here and there), but there are also some problems that I didn't think of upfront. For example the current implementation does not work with template cache. RockFrontend has a setting for this in the module settings and now RockPageBuilder also has one. Please download v5.7.0 😎
  3. This sounds like a perfect use case for RockGrid, if your clients have 65€ left (docs are under construction but if you need help I'm around). But again you have several options. You could also use regular page listers. Or you can use Lister Pro. When using RockGrid you get any table shown at https://tabulator.info/ Or you could create a custom admin page and build a custom tabulator yourself. It's not that hard if you know JS and HTML. RockGrid comes with a lot of extras, like SSE for bulk operations, action buttons (including ajax operations) etc., but if you just need a table then it's quite easy to just add a tabulator table to the backend. Oh, and we have the relatively new PageListCustomChildren
  4. We always have to deal with exceptions, right? I'm always using the $rm->setPageNameFromTitle() helper that will update the pagename according to the page title on save. That's easy to do in a MagicPage: public function init(): void { $rm = rockmigrations(); $rm->setPageNameFromTitle($this); } But what if we wanted to make sure that one page has a custom page name that can't be changed, so that we can rely on the url eg in a fetch() call? public function onSaveReady(): void { if ($this->id === 6840) $this->name = 'versandkosten'; else rockmigrations()->setPageNameFromTitle($this); } We have to use the magic "onSaveReady()" method, because in init() and in ready() we cannot use $this to access the current page, because init() and ready() are triggered on a NullPage object and not the page itself. The reason for this is interesting but not for this post πŸ™‚
  5. Hey @nurkka thx for your questions! What do you mean exactly? Which modules did you install? This is expected. RockFrontend will only compile all .less files to one.css file. All other files will stay single files. This is because on some pages we might need some scripts, on others not. If all were compiled to one single file we'd have different files on different pages or we'd keep recreating this file over and over again when viewing different pages. At the moment no, for the mentioned reason. I thought about adding such a feature, but I think it would cause trouble. RF/RPB try to be as unopinionated about the frontend as possible, but some things need to be there to make it work. Can you please show me the content of these files?
  6. I've mentioned several times that one reason why I love latte is that LATTE == PHP (almost) This tool shows what I mean: https://php2latte.nette.org/ @FireWire
  7. Hey @FireWire thank you for the composer file, that helped! Sorry to say that, but this is nonsense πŸ˜‰ I didn't know for certain, but from my understanding if I do "composer require latte/latte" it should not matter WHERE I do that as long as I use the correct path in my require_once /path/to/autoload.php So I tried doing "require_once /path/to/rockfrontend/autoload.php" above the CustomLatteExtension class and that fixed my error. The reason is simple: In ready.php the latte autoloader was not available, because I have added the "require_once /path/to/composer/autoload.php" in the "loadLatte" method of RockFrontend, since I thought it would be more efficient to only load it if needed. I think that was wrong and I moved it into init(), because that's the whole purpose of the autoloader... to load things only if necessary, right?! So with the latest version on the DEV branch you can add your extension without installing anything in your root folder and without adding any require_once anywhere. I experimented with this: <?php namespace ProcessWire; use Latte\Extension; final class CustomLatteExtension extends Extension { /** * Define functions available in all Latte files * These can be anything ProcessWire related or not, any functions defined here will be available everywhere */ public function getFunctions(): array { $functions = []; foreach (wire('all')->getArray() as $key => $value) { if (!is_object($value)) continue; $functions[$key] = fn() => $value; } return $functions; } } But that is not a reliable solution. I'll ask for help in the nette forum. I think the only reliable solution would be to add the ProcessWire namespace to all compiled latte files. That sounds like side effects though. But we'll see...
  8. This is what RockFrontend has in its composer.json: "require": { "latte/latte": "^3", "sabberworm/php-css-parser": "^8.4", "matthiasmullie/minify": "^1.3", "wa72/htmlpagedom": "^3.0", "baumrock/humandates": "^1.0" }, How does your composer.json look like?
  9. I've recently hit 10.000 views on my youtube channel (over all videos since the beginning 2+ years ago) πŸ₯³ I'm counting 218 subscribers and all have watched 800 hours of (almost only) ProcessWire content. The best performing videos so far are: Recent videos have been by far less popular. I don't know why. Maybe it's the thumbnail. Maybe the video length (the RockFrontend video is over 40min long!). Maybe it's the algorithm. Who knows. But Ive learnt a lot and recently I found a way to be more efficient with creating those videos - unfortunately I didn't get any feedback in that regard, but feedback is rare on my channel in general. Maybe that's part of the youtube game πŸ™‚ So I'm asking here: What is your opinion about these videos? Are the videos helpful? Could anything be improved (easily πŸ˜… )? What would you like to see as a next video? RockMigrations Deployment RockMigrations in general More about RockFrontend More about the commercial modules Less about the commercial modules Anything else? Thanks for "watching" and have a great weekend πŸ™‚
  10. In ProcessWire as always you have the freedom to choose from a variety of options. What fits best for you and the editors depends on a lot of factors, but I'd say your options are (from easy, but with default style and options to hard with full freedom): Stick with PW page tree, organise your pages well and properly define access of your users so they see only what they need to see. That's probably the easiest solution, but you get the default PW backend which has pros and cons. Use a module to adjust the backend to your needs. Possible modules are AdminRestrictBranch or the dashboard module. Or any other module that helps you to customise the backend. Create custom admin pages. This is still very easy and you stay in the "safe" PW backend, which means you don't have to take care of everything on your own and you can build on top of proven and battle-tested concepts and code. Create a custom backend. The ProcessWire backend is on its own just built around the PW api, so you can build something similar on your own. This is by far the option with most freedom but also the hardest option, as you have to take care of almost anything (access control, rendering, navigation, etc...) Somewhere in-between those options might be to enhance your frontend with some shortcuts, like buttons to "add new blogpost" or to "manage items" or whatever. These buttons could directly link to backend pages, so it might be easier for clients to find what they need, because what many often forget is that even though the PW backend is super clean and easy to use, there is a barrier or gap between "frontend" and "backend" that for clients is sometimes harder to grasp than one might think! RockFrontend, for example, comes with ALFRED, which adds hover info with an edit icon: And when clicked it opens the dedicated page from the backend directly in a modal in the frontend: There are other modules with similar solutions as well. You have the freedom to choose πŸ˜‰
  11. Thx, but I don't think it's very smart πŸ˜„ It's really just PHP, that's one of the main reasons why I like latte so much. They don't reinvent PHP or invent another syntax, they just use PHP and add some helpers here and there. It's really easy to understand, for example create the file php-demo.latte: {file_put_contents('php-demo.txt', 'latte-is-cool')} This will do two things: It will create the file php-demo.txt in the folder of the .latte file It will output "13", which is the strlen of "latte-is-cool" You can think of { ... } being similar to <?= ... ?>. That's why tracy will instantly work inside latte via {bd(...)} as bd() is a globally available function without any namespace and it does not return/output anything. To prevent our previous example from outputting anything you can simply add "do": {do file_put_contents('php-demo.txt', 'latte-is-cool')} Also when using {var $foo = 'whatever'} there is no output. Now consider the following file "php-demo.latte": {wire()->page->id} This will cause the following error: You can click on "PHP" and then you see which file it actually renders and why wire() is not found: Once you click on that file link, it will open up in your IDE: So you can see that this is the compiled PHP file that latte uses to render your .latte file. And your IDE shows, that wire() is not available! So using our IDE we can fix the issue: Which will add this to the PHP file: Now since we can't add the use statement to our latte file like this: {use function ProcessWire\wire} {wire()->page->id} We just use the inline syntax for namespaced functions: {ProcessWire\wire()->page->id} And that's all you need to understand πŸ™‚ But I'll probably add the functions api without namespaces to all .latte files once you help me get the mentioned issue sorted πŸ˜‰
  12. Hey @FireWire thank you very much for taking the time to explain everything. That's great and I understand now! I have an idea, but I tried adding your example to /site/ready.php and I get this: This is my ready.php: <?php namespace ProcessWire; if (!defined("PROCESSWIRE")) die(); /** @var ProcessWire $wire */ $rockforms->setErrors('de'); use Latte\Extension; final class CustomLatteExtension extends Extension { /** * Define functions available in all Latte files * These can be anything ProcessWire related or not, any functions defined here will be available everywhere */ public function getFunctions(): array { return [ 'wire' => fn(?string $property = null) => wire($property), ]; } public function getFilters(): array { return [ 'bit' => fn(mixed $value) => new Html(filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 1 : 0), 'bitInverse' => fn(mixed $value) => new Html(filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 0 : 1), ]; } } $wire->addHookAfter( "RockFrontend::loadLatte", fn(HookEvent $e) => $e->return->addExtension(new CustomLatteExtension), ); Do I have to require_once something? I have never added a custom extension yet.
  13. Looks great. Wouldn't that be worth a PR?
  14. Hey @zoeck thx yeah that test2.l was helpful and I've fixed that in v3.21.2
  15. Some of you may be interested to know that yesterday I released RockCalendar, which also has recurring events and will be actively developed and maintained for the foreseeable future:
  16. Hey @zoeck thx. I just tried and it seems to work. What exactly do you mean by "didn't work"? Steps to reproduce please.
  17. RockMigrations v5.3.0 Added an automatic Modules::refresh() before executing $rm->installModule() Added GET_PHP_COMMAND for deployments as requested by @snck Added docs for the great filesOnDemand feature
  18. RockFrontend v3.21.1 Several improvements in the docs Added support for nested AJAX Endpoints (see video below)
  19. I've just released RockCalendar with a hopefully helpful intro video. I want to thank @monollonom and @BrendonKoz for all the input you gave here. If you want a free single site license for testing (and eventually reporting bugs πŸ˜… ) please write me a PM.
  20. Hey ProcessWire community! I'm excited to introduce RockCalendar, a new calendar module that brings powerful event management capabilities to your ProcessWire sites. Key features include: Full calendar view in the ProcessWire admin Easy event creation and management Drag-and-drop event scheduling Recurring events (SSE powered, needs RockGrid) Seamless integration with ProcessWire pages and fields I've created a detailed video walkthrough showcasing RockCalendar's features and installation process: Check it out and let me know what you think! I'm here to answer any questions you might have about RockCalendar. Download & Docs: https://www.baumrock.com/en/processwire/modules/rockcalendar/ Happy coding!
  21. That's a great idea, but I think it would be better placed in a dedicated thread πŸ™‚ Haha, well... it had to have some name πŸ˜„ Yeah that would be the concerns that I had... Let's wait a little for more feedback πŸ™‚ Totally understandable. I've also thought about creating something like this totally open source, but this is not possible for several reasons. One is that I'd have to reinvent several of my modules (RockPdf, RockGrid) and another one is that it has to generate income. I know some don't like this, but nobody can live from love and likes. Thx for your input!
  22. The --watch command is fine and as I said most likely what 99.9% of tailwind users do. I don't like it, because it does not recompile the css in the way "npm run build" does. It has some caching, so if you add classes during dev and then remove them, they stay in your css, which I don't like, because I want to immediately be able to "git commit" my changes without having to run "npm run build" before (and likely forget that). But if watch works for your setup its totally fine to use. Again. I can't recommend DDEV enough and in the time of your troubleshooting you'd likely had it installed and working ^^ I don't know why you added components here, but if you need them go ahead. The problem with adding anything other than what I do in the site profile is that these things often interfere with UIkit or whatever framework you use. If you don't use one and use only tailwind then of course you'll likely want to add components as well. For me all the necessary tailwind magic comes from the utility classes. Everything else I'm using UIkit for.
  23. This is a request for honest feedback. --- first, some background --- It's the first of October and I'm doing my bookkeeping. This has been a pain for me for a long time, but nowadays I'm - believe it or not - really enjoying it. That's because I've developed a system over time that makes it fast and efficient for me to charge all my customers that have a maintenance contract. It's basically just a few clicks and some days later I have the money on my bank account. I try to provide as much value as I can for that money, which involves managing their web hosting (on a dedicated VPS), doing backups, monitoring their services for uptime, etc. I'm not getting rich from that money nor is it enough to live from (at least not in Austria πŸ˜„ ), but it is money that I get where computers do the work for me even when I'm having some time off, which I think is great. I try to make it visible for my clients that I provide a lot of value every month by a monthly performance report which looks like this: This is very basic at the moment, but I think it looks quite nice and it does its job. I also have another system that creates invoices for the work that I do (eg monthly contract, custom web development, bug fixing, new features, etc) and another system where I manage my time tracking. --- now here is my question --- All of that is based on ProcessWire and quite outdated. I want to rebuild this at some point, but I'm only having a handful of clients, so it's kind of overkill to develop something like this for just a few clients/euros. But I think it's very nice and I enjoy developing these things, so I'd really want to do it. Now I was wondering... Could other ProcessWire users also need this? I guess there are many self employed users in the community and maybe some are struggling with the same challenges or are working on the same goals? Or are you in a similar situation and have solved it differently. Maybe with some software that already works great for you. I know there is a lot of commercial and even open source software out there, but I love ProcessWire for its flexibility and customisation opportunities and perfectly tailored workflows - for me - make the difference between something being tedious or fun. πŸš€ What do you think? If there is no interest I'm likely going to build it for my own πŸ˜„ If there is interest we can think of how to make it work and be beneficial for everybody. Now back to my bookkeeping ... πŸ˜…
  24. @palacios000 Please also have a look at the discussion here: https://processwire.com/talk/topic/30449-questions-and-syntax-latte-template-engine-by-nette/?do=findComment&comment=244743
Γ—
Γ—
  • Create New...