Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/29/2024 in all areas

  1. Hard to know exactly what to suggest as many different scenarios could affect responsiveness. (Re-?)Rendering images could easily slow things down, as could page reference properties that aren't loaded until called/necessary. Depending on your setup, using findRaw() or findMany() might have a positive impact, as would your autojoin; if you think an autojoin might only be necessary for your one scenario, you could look into findJoin() and whether it accomplishes the same end-result on that page. For a ProcessWire (Pro) module assist, there's always ProfilerPro, as well.
    3 points
  2. Currently, I am using the paid version of Bito.ai in PHPStorm for chatting and Supermaven free for "coding completion." They work well side by side. Bito's GUI and the generated results are quite impressive (as they include clear explanations of what was suggested and why, as well as the assumptions made by the AI engine (also known as LLM)). Even Bito's web account features are nice and informative. Bito indexes the whole codebase and one only needs to tell it to use that, but in my prompts I always tell the engine what classes and what methods to deal with (if appropriate, of course). Since it looks up the whole codebase, sometimes it might creatively pick classes/methods form other off topic places but in that case it is usually enough to guide it to back to topic. The only strange thing about Bito is the subscription scheme: a monthly subscription starts at the beginning of the month. Since I subscribed a week ago, I only had to pay for the remaining days of August, which was fine for me, as I did not have to pay for a full month just to test it. @dotnetic Sourcegraph Cody looks cheap, so thanks for the tip! I will test that as well.
    2 points
  3. Drop all the others (Supermaven, Copilot, Cursor) and go with Sourcegraph Cody. It supports multiple LLMs (Claude, GPT40, Mixtral, Gemini, or even local models), , integrates smoothly with VSCode, and gets regular updates. Cody is fast, supports custom commands, and has an excellent UI with a well-integrated diff feature, similar to Cursor. It also uses your entire codebase or other public repos as context when answering questions. IntelliJ-based IDEs are supported too, but the UI isn't as polished yet. Improvements are expected by early September. I haven't done a direct speed comparison, but Cody feels quick, and I’m not missing anything.
    2 points
  4. Alternatively, you can just use different logic on your interactive procedure. I do something similar to this with just a single field, where the first image (manually sorted) in an images (Multiple Images field) is used as the primary/cover photo. All of the rest are placed into the standard gallery. The API makes that easy with the WireArray class methods of first() (only retrieve the first when using the "cover photo" as a portfolio thumbnail) and shift() (if you wanted to separate the first/cover photo from the rest of the group in a template). Images are files, so you can use the same logic for file fields. If you don't want to modify your template(s) and would prefer to keep your logic flow intact, what dynweb mentions should work too. 🙂
    2 points
  5. Hello I made a website with Processwire some years ago and now the Hosting service says, that I have to update the PHP of the site. Can anybody please help me how to do that? Do I have to update the whole Processwire CMS or can I just exchange a .php file somewhere? Thanks for any help Jakob
    1 point
  6. I bet $contact is coming from a page reference field that is configured to return false when empty. So if $contact is optional, the code should verify its value before to use it and call renderContactSmall(). For the empty selector, it's necessary to investigate the code that generates it, and log value of variables it's using.
    1 point
  7. When I need to load a fair amount of data I do custom MySQL queries. findRaw() is very fast too but I don't like to parse its results. Just be careful to sanitize data where needed (all texts at least). The downside is that it takes much more development time. But I become better in MySQL stuff. 😁
    1 point
  8. This is difficult to fix without more of the surrounding code. This isn’t on Github by any chance? If you’re not comfortable with fixing it yourself, you should probably give someone with expertise in PHP or ProcessWire direct access. Also please use the code formatting to post snippets, instead of quotes. Try to see if you can find where $contact is declared in the first 25 lines of structure.php. Apparently it’s a Boolean, but is expected to be a Page.
    1 point
  9. I've done a video about DDEV, but it doesn't go through setting up ddev. Just follow the instructions on the ddev website. For this you need to tell tracy debugger where the files live on your local file system. This is because PW + Tracy run inside the container and inside the container your files live in /var/www/html. So if you click on a debugging link in tracy then your OS tries to find the file /var/www/html/foo.php and obviously can't find it. // tracy config for ddev development $config->tracy = [ 'outputMode' => 'development', 'guestForceDevelopmentLocal' => true, 'forceIsLocal' => true, 'localRootPath' => '/path/to/your/project/', 'numLogEntries' => 100, // for RockMigrations 'editor' => 'cursor://file/%file:%line', ]; The important part for you is the "localRootPath" setting.
    1 point
  10. I'm really enjoying DDEV and ProcessWire as I dive back into web development more seriously after many years. However, debugging has always been one of my weak areas, and I'm keen to get that sorted out. So far, I've struggled to find a great tutorial on setting up DDEV with VS Code specifically for ProcessWire. Most of what I've come across are lengthy Drupal tutorials with Drupal-specific settings, which end up overwhelming me. If there isn't a good resource out there, could you please share your setup procedure and the VS Code extensions, settings you've made in "settings.json" that you use with your DDEV ProcessWire environment? For example, I'd like to be able to open a file with a reported error from Tracy Debugger in VS Code, by clicking on it but of course: but my current setup isn't allowing me to do that. I'm also using RockFrontend—thank you @bernhard It's a pleasure to work with, especially when adapting static HTML templates. Thank you so much.
    1 point
  11. @BrendonKoz Thanks for your reponse, yes this would absolutely be the reasonable solution in most cases, but the structure I have here is weird and it seemed relevant to have 2 separate fields at the time I created it. Maybe in hindsight I still should have gone for this solution, but it's just a personal project so I can't be bothered to change everything now, I'll have it learned for next time :^) @dynweb Thank you very much this is what I was looking for. Here's what I ended up doing, it works perfectly if ($cover_image) { $images = $images->prepend($item->cover_image); } if ($cover_video) { $videos = $videos->prepend($item->cover_video); }
    1 point
  12. After doing a test and seeing your gif could it be because you’re also slightly moving the mouse on the Y-axis? Maybe the slider should stick to one axis once you passed a certain threshold?
    1 point
  13. Jep, since 12.1.2024 🙂 https://processwire.com/talk/topic/29439-cursor-might-be-my-vscode-replacement/#comment-238405 For me it's absolutely worth the 20€ per month. It helps me a lot with JS and CSS and sometimes also PHP, but the better you are with a language the less often you'll need help from the AI. I think so, yes.
    1 point
  14. Hey, @kuba2! The issue is not PW itself, but rather a 3rd party module - MarkupSEO. It has not been updated for awhile (8 years))) You should: Solve the issues in this module yourself (the author is not around anymore AFAIK). Use a more modern SEO module like this one. Remove all the SEO modules and cope with SEO needs with regular fields and creativity. Anyway, you need to be able to change PHP versions back and forth and see what other modules might need an update.
    1 point
  15. @Stefanowitsch if you hook into Pages::saveReady then you modify the $page object right before the save happens. For example you can just set $page->title = 'foo' there without saving, because PW saves the page object right after you modified it. If you hook into Pages::saved the save has already happened. In that case you need another $page->save() after you modified anything. Sometimes it's better (or necessary) to use Pages::saved, sometimes you can just use Pages::saveReady to be a little more efficient.
    1 point
  16. Hey @kuba2! I've got PW installations running PHP 8.1. So it should be possible. What exactly doesn't work? Show us the errors you got.
    1 point
  17. Great! This has been annoying me over the last few days as well (and on any previous project), but it was not annoying enough to have the idea of supporting custom stubs per project so your input was highly appreciated ? If any of you guys have any other suggestions how to further improve the day to day development experience when using RockPageBuilder please let me know!
    1 point
  18. @bernhard Oh heck yeah!!! That's going to be a gamechanger for me and really appreciate it!
    1 point
  19. Here you go: This version will be merged next week. I'll send you a copy to test!
    1 point
  20. Podcast you probably want to watch:
    1 point
  21. Apologies if this is slightly off-topic, but it was one of the reasons I took a different approach with ProcessDbmigrate. That creates and reads json files and can be used on any existing database. Since I first built it, RockMigrations has moved on quite a bit, but I still like my module. I recently used it to create a skeleton site from an existing project, for example - just the fields, templates and pages I wanted. I have for some time been considering making it more interoperable with RockMigrations - e.g. to create the migrate code from the json file. I don’t know whether that would help, and haven’t really started looking at in detail, but it’s a thought.
    1 point
  22. These things are so easy to do with RockMigrations: <?php // site/migrate.php $defaults = [ 'type' => 'image', 'maxFiles' => 1, 'descriptionRows' => 1, 'extensions' => 'jpg jpeg gif png svg', 'maxSize' => 3, // max 3 megapixels 'icon' => 'picture-o', 'gridMode' => 'grid', // grid, left, list ]; $rm->createField('your_image_field1', $defaults); $rm->createField('your_image_field2', $defaults); $rm->createField('your_image_field3', $defaults); You can then set custom labels for your fields or you can even set custom properties either in migrate.php overriding the defaults or via GUI as template context override. PS: If the fields already exist you CAN use ->setFieldData() instead, but ->createField() will work as well. PPS: If you need to change a setting just change the setting in the defaults, save the file and refresh your web broser!
    1 point
  23. Version 2.0.16 now released. This comprises mosly bug fixes after extensive testing on some really complex migrations involving many templates fields and pages. In particular, the module will automatically carry out multiple migration installations to deal with the problem of circular dependencies between changed objects. Not sure how many people are using this module, but any feedback is welcome.
    1 point
  24. You can do it with a module or manually. https://processwire.com/modules/process-wire-upgrade/ https://processwire.com/docs/start/install/upgrade/
    1 point
  25. Many thanks for Your good answer! Is that a difficult thing, upgrading Processwire? Thanks again
    1 point
  26. Hello, updating PHP means you need to install a newer version of PHP, it's not directly related to ProcessWire in first instance. It depends of your OS (Windows, Linux), it also depends if this is a shared host or a dedicated server. In a shared host you usually have an administration interface provided by your hosting service to manage your server. In a dedicated server you generally do everything yourself. About ProcessWire you have to check that the currently installed version is compatible with the PHP version you plan to install. Probably it won't be OK because you talk about years. If you plan to install PHP 8+ you'll also need to upgrade PW.
    1 point
  27. After 10 years of PW development it looks like a break-through!? @MarkE thank you! I'll consider using PW again in my next prj.
    1 point
  28. Sure. Part 1 is here: https://1drv.ms/v/s!AmS0-Sk4lDz9h5tDqJwj50qq6-KEhg and part 2 here: https://1drv.ms/v/s!AmS0-Sk4lDz9h5tS2DJsT94F92fJmw If you want to play with it over the holidays ?, the best thing to do is to create a clean PW installation - ddev is great for doing this quickly - and I would recommend add ProcessDatabaseBackups and TracyDebugger. Start by following similar steps to the video. Note that, in the video, I have 'simulated' the migration installation by taking a backup before adding new fields etc. Take another backup after creating the migration, then restore the original one, changing the database name in the module config. And don't forget to RTM: https://metatunes.github.io/DbMigrate/help.html
    1 point
×
×
  • Create New...