Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by dotnetic

  1. Just like I would normally get the image url via the pages API. I just need one image in my case and so the output of a request like $result = $this->pages->findRaw( 'template=shop' . $filters, [ "id", "title", "myImage.httpUrl", ], ['flat' => true] ); should include the path to the image. Or if I just reference the image file as "mo_image" in the query, I get this result: There is much information about the file, so why not include the url in it? Also I don't understand why the results are always arrays, as they are normally just single values. This problem also exists for page reference fields which can be seen in Add $pages->findRaw() option to return "single" Page Reference field values directly · Issue #458 · processwire/processwire-requests (github.com) (please vote for it to be fixed). I know that in RockFinder you can get the image url via the callback approach, which I like. But this again queries the page with all it's fields and so the speed improvement of findRaw is gone.
  2. Thanks for the workaround idea, but it requires to re-save all pages that have an image. But still I would love to support for getting pageImages in the core findRaw.
  3. I am also wanting a solution for this, or at least get the path to to the image url. I want to use this data in a data grid to render the image. Normal pages->find operator is slow with many pages, so it is no fit for me. I also tried findJoin, but it also seem it does not work for images? We should open a request at processwire/processwire-requests: ProcessWire feature requests. (github.com). Are you doing it, @MSP01?
  4. Another thing is, you can re-use custom page classes in new projects and have their fields/templates created automatically. Develop them only once, copy them over to a fresh PW install, and there you go.
  5. What do you struggle with @Ivan Gretsky? I use RockMigrations for every project right now. You got version control for your fields and templates, and even more. So if you are using git and develop new features, it is of great use because it adds the needed fields/templates when switching branches. Also in conjunction with RockFrontends livereload feature, this is a lot of fun. You add a field in the migrate.php (or somewhere else where you need it, like a custom page class) and the page in the admin autmatically shows the newly added field. This made my workflow so much quicker. I don't use the deploy feature (github actions) because I got my own github actions, so I can not say anything about that.
  6. Very nice addition. Was also hoping for support for adding it via composer.
  7. Thanks @bernhard for adding what we discussed earlier. Works fine 🙂
  8. You can import the attached file into your IDE. See instructions here https://www.jetbrains.com/help/phpstorm/sharing-your-ide-settings.html#import-settings-from-a-zip-archive I don't have much time atm and so I can not provide full instructions and the file not in a repo. Please note, that if you use settings sync, the import will not work and you have to put the "template" folder of the zip file into your PHPStorm settings folder which is depending on your OS somewhat like C:\Users\username\AppData\Roaming\JetBrains\PhpStorm2022.2 (Windows) paste it here! settings.zip
  9. Until we might have a native method for migrations, I encourage you to checkout the great RockMigrations module. With the module you can have one or multiple migration files, that handle all the stuff mentioned above, like adding fields, adding templates, creating pages with content and setting roles. As the migrations are file-based they are also version-controllable. It is also a hassle-free setup and very easy. This makes it easy to work on a feature in a different branch which requires to have other fields/template than in the main branch. Now you can switch between branches and always have the required fields and templates. This is a huge time and workflow improvement. @bernhard steadily improves his module, and me and other contributors try to enhance it, or give feedback.
  10. Did it, because I need the same Please make InputfieldPage::getPageLabel hookable · Issue #460 · processwire/processwire-requests (github.com)
  11. Any javascript errors in the Dev Tools console? Install Tracy Debugger and see if errors occur there
  12. Just the ProcessWire Code, I have to transform everything manually. Sadly IntelliJ has a weird format for the live templates which are stored in an XML file. Sharing and importing isn't also as easy as copying the files to the root directory. Instead you have to import them as settings for the IDE and restart the IDE afterwards. Live templates are a native function of PHPStorm, I think they were a thing before they existed in VSCode. It is somewhat similar to snippets in VSCode. You have your code and then enter $myvariable$ for inserting user text, or things like $boolean$ or $enum$ and can define values for that.
  13. Coming to an IntelliJ IDE (like PHPStorm) near you soon. Live Templates or snippets provide a short way to write repeating code. You enter an abbrevitation and the editor completes the code for you. Here is one example when I want to setup a new module: phpstorm64_aT7Nj2gxSv.mp4 @bernhard Has snippets for VSCode in his great RockMigrations module also, be sure to check them out, if you use VSCode. As I use RockMigrations in every PW installation I also add snippets for migrations: phpstorm64_fAD9MoUJLE.mp4
  14. RockMigrations is the best tool to do migrations with ProcessWire. It saves me so much time when creating new projects or extending older projects. Once you use it and understand it, you don't want to live without it! Thank you very much, @bernhard. Also a good video. I think you explained it very well, hopefully even for beginners. What personally nags me most in every module demonstration video out there (not only from you) is how to install a module. That is annoying to me, but might be useful for others. Gladly I can skip that part and you also added timemarks, sections to the video. Keep up the great work.
  15. That's true. Sadly I am a performance junky and interested in new and shiny things, and so I try out almost everything. Another hint: Use bun instead of npm for installing npm modules. It is sooooo much faster. It can do much more, but I use it just as a npm replacement for now.
  16. Hi @gebeer. Using webpack nowadays feels a little bit outdated for me, because with vite (from the creator of vue.js) setup is so much simpler and faster, and it comes with first-class support for most frameworks like Tailwind or vue out of the box. But it can't do all things webpack does (not yet). Two or three years ago I used a similar approach to what you did now, as you can see in my jmartsch/acegulpandpack: A set of gulp tasks with JS transpilation, webpack, SVG Sprites and minification (github.com) repo. With vite you use native ES modules instead of transpiling and bundling every time something changes. This makes the development process much (MUCH) faster. If you ever seen it in action, you would not like to go back to webpack. If you guys are interested in a modern build environment for your CSS and JS, I could see if I find the time to write a tutorial for it.
  17. Update August 2022: There finally now is a native way of opening the correct file and line, if tracy throws an error. Please see the updated first post.
  18. Yes exactly but with an easier syntax (imho), but dump is just one example. I don't know anything about the caching, and yeah it is bad that not the real file is shown in the dump
  19. I used Smarty and Twig before, and have to say, that Latte feels much better, and the conditional rendering of elements is a great simplification.
  20. This is just syntactic sugar and uses Tracys debug bar, similar to using `{bd ($myvar)}. Using things like tags and filters are also syntactic sugar. {$page->intro|noescape} // or <div n:if="$features"> Tags have some advantages over plain PHP in the template context. For example they are chainable and easy to read/write: {$page->intro|noescape|upper} // outputs unescaped HTML content in uppercase
  21. I did not upgrade yet, I am in the process of integration Latte v3 into the TemplateEngineLatte renderer, but still need time for it. Right now I am using v2
  22. Or just use {dump $page->title} I think you can drop the parentheses after items or content. Also you might want to use a n:if clause on the ul, so the markup is discarded if there are no items. <ul n:if="$block->items"> <li n:foreach="$block->items as $item"> <a href="#">{$item->title}</a> <div>{$item->content|noescape}</div> </li> </ul> I am also using Latte in an actual project and love it so far. For the integration into ProcessWire I am using TemplateEngineFactory. It also has a Latte renderer (but with Latte 2 atm, actual version is 3).
  • Create New...