Jump to content

bernhard

Members
  • Posts

    6,638
  • Joined

  • Last visited

  • Days Won

    360

Everything posted by bernhard

  1. @gornycreative the issue is already fixed on the latest dev: There has just not been a version bump since then.
  2. There are so many things that I want to show on video, but it's a lot of work ? And I'm quite busy working on another surprise ? But I'm happy when people let me know what they think would be interesting... The camera doesn't talk a lot ?
  3. Hey @gornycreative I've just pushed that do the dev branch and it will be available in the next release of RockMigrations. I have added "permissions-" and "access-" keys to the migrate() method. I have to correct myself here. Actually the default is that RM keeps existing values! That's in line with how it works in general. It only add's things or overwrites them but it does not remove anything unless you tell it to. Could you please grab the dev branch and let me know if everything works as expected? https://github.com/baumrock/RockMigrations/tree/dev
  4. Ok thx I think I get the point ? Maybe I was not seeing the problem because RockFrontend let's you split your markup in as many files as you want, which is also helpful with HTMX. In your template you could have this <div uk-grid> <div n:foreach="$page->cards() as $card"> {$rockfrontend->render('partials/card.latte', $card)} </div> </div> And in your HTMX Endpoint you could have this: <?php $wire->addHook("/cards/{id}", function($event) { $rockfrontend = $event->wire->rockfrontend; $post = $event->wire->pages->get($event->id); if($post->template != 'blogpost') throw new Wire404Exception("Invalid Page"); return $rockfrontend->render("partials/card.latte", $post); });
  5. Thx @Robin S for your snippet, it was really helpful today ? When using RockMigrations MagicPages this gets as simple as adding this to your custom page class: public function editForm($form) { $form->get('title')->useLanguages = false; }
  6. Looks like htmx has you covered ? I read the docs like you can add "hx-headers" to your <body> and you're done.
  7. I've only little experience with HTMX. Is your request for making something possible that currently is not. Or is it about making something easier? Or is it about making something more performant? I thought you can simply request the whole page and HTMX will select the correct elements to replace? If it's about performance I'm not sure if your suggestion is really a good idea. The whole page would in my case almost always be pro-cached and therefore requests would be blazing fast. If the request returned only a portion that was not cached I guess it would be a lot slower. But it's just a guess ? I'm missing the WHY - maybe you want to explain that a little more detailed so that others that are not familiar to HTMX can better understand? Maybe @Jonathan Lahijani can also explain the gymnastics that are necessary at the moment?
  8. I've recently had to switch to a new machine and it was no issue. If I remember correctly I did not sync anything. Sometimes a refresh is a good thing to throw away things that you once installed and never needed again. Things that I'm missing I will realise immediately and just reinstall. But VSCode recently introduced Profiles (https://code.visualstudio.com/docs/editor/profiles) which would do exactly what you are asking for.
  9. https://processwire.com/talk/topic/22369-hide-uneditable-pages-in-admin-treeprocesspagelist/?do=findComment&comment=221884 Is that what you are looking for?
  10. As this was the first google search result for PW get CSV I just wanted to mention that we now have $files->getCSV() https://processwire.com/api/ref/wire-file-tools/get-c-s-v/
  11. Hi @gornycreative did you read the docblock? Does that solve your need? In general RM has the convention that SET means set, which will wipe old settings. Or at least I tried to have that convention. setTemplateFields works differently and has that parameter that you are suggesting. For fields in migrate() we also have the "fields-" key (with minus sign), that makes setTemplateFields remove fields that are not listed in the array. Similar to that we could have "permissions" and "permissions-" which will in the first case add all listed permissions and in the second remove non-listed ones.
  12. I guess you are not missing anything but RockMigrations is missing the "setRolePermissions" method. I've done some aggressive cleanup when transitioning from RM1 to RM2 to make sure that RM2 does only have methods we really need to have. Could you please copy https://github.com/baumrock/RockMigrations1/blob/1ee9f9eb4afaf83529bcedf443b31dd63a5403c8/RockMigrations1.module.php#L2135-L2145 over to RockMigrations.module.php and let me know if that solves the issue?
  13. I think that is the simplest and cleanest approach. It's possible to spin up multiple databases for one project (https://stackoverflow.com/questions/49785023/how-can-i-create-and-load-a-second-database-in-ddev) but as long as you don't need to have both projects talk to each other I think having them isolated would be the way to go. Just curious: Did you also find processwire.rocks or did that not pop up in your search? Especially the video about RockFrontend could be very interesting for you. I second that recommendation. Having a css framework has helped me a lot to get things done (and work ? ). I'm a huge fan of UIkit and especially in combination with RockFrontend it's a joy to use. I'd be curious in why you switch to bootstrap @szabesz? I've been looking into Bootstrap recently as there is a lot bigger ecosystem around bootstrap. There are so many great and free templates for bootstrap, but none for uikit. Also their efforts on using css variables is very interesting! I'm just a little afraid of the switch. RockFrontend + Less + UIkit work so well and I usually have all the tools that I need and even the awesome UIkit Javascript Microframework is so nice (https://github.com/uikit/uikit-site/blob/feature/js-utils/docs/pages/javascript-utilities.md) that I'm afraid I'd be missing something on bootstrap ?
  14. I'm also using DDEV for 1,5 years now coming from Windows+Laragon and I could not be happier. Can't remember of any issues and changing PHP versions is as easy as changing the config file and doing a "ddev restart". Also it makes things possible that were not possible with Laragon, for example on one project I needed poppler-utils for generating JPG images from PDF. On the linux server this worked nicely but on Laragon not. So local development was different from the live server environment and that's not ideal. Also when working on projects in a team DDEV is great. Just share the github repo of the project including the config.yaml of DDEV and your teammate just have to do "git pull && ddev import-db -f /site... && ddev start"
  15. This is imho a great video from the creator of Alpine.js:
  16. I've only just installed it, but it's really nice to have this in my IDE rather than having to go to github. I'm just now realising how often I've done that in the past. Now I have everything I need in VSCode ?
  17. Two great news!! 1) The module directory now reads module version numbers from package.json files!! Now when using automated workflows like shown above your module's version in the modules directory will automatically be in sync with your module ? 2) Microsoft has just released the github actions extension for VSCode that helps developing and debugging github actions directly from within your IDE!! https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions
  18. ddev import-db -f site/assets/backups/database/db.sql is a very helpful command that can import dumps without PW running ?
  19. This is the rm-defaults snippet which I always use and works for me: <?php $rm->setPagenameReplacements('de'); $rm->setModuleConfig('AdminThemeUikit', [ // use consistent inputfield clicks // see https://github.com/processwire/processwire/pull/169 'toggleBehavior' => 1, ]); $rm->setModuleConfig('ProcessPageList', [ 'useTrash' => true, // show trash in tree for non superusers ]); // install german language pack for the default language // this will install language support, download the ZIP and install it $rm->setLanguageTranslations('DE'); $rm->installModule('LanguageSupportFields'); $rm->installModule('LanguageSupportPageNames'); $rm->installModule('LanguageTabs'); $rm->setFieldData('title', ['type' => 'textLanguage']);
  20. I've just added a small PR that makes PW load config-local.php additionally to config.php if the file exists: https://github.com/processwire/processwire/pull/267
  21. Lol, indeed! ? If you enable trailing slashes you get redirected from non-slash to slash urls ? Thx for the quick help!
  22. I'm not using url segments very often. Now I do and I'm a little surprised that there is no setting to force a trailing slash?! Searching the forum has also not lead to a helpful solution. Does anybody have a good and easy solution for it? Does it even matter from a SEO perspective?
  23. I've had similar problems. That's why RockMigrations comes with this: $rockmigrations->deletePage($page) This is how it works, maybe it helps: https://github.com/baumrock/RockMigrations/blob/1089f625048c4c68e883e46d1d57d7153c155bf2/RockMigrations.module.php#L1316
  24. @adrian's tracydebugger also has an api explorer panel that you might be able to get inspiration from ?
  25. Hey @adrian this is the whole block: // Session if (in_array('session', $panelSections)) { $session_oc = 0; $session = $this->sectionHeader(array('Key', 'Value')); foreach ($this->wire('session') as $key => $value) { if ( $key == 'tracyDumpItemsAjax' || $key == 'tracyDumpsRecorderItems' || $key == 'tracyEventItems' || $key == 'tracyMailItems' || $key == 'tracyIncludedFiles' || $key == 'tracyPostData' || $key == 'tracyGetData' || $key == 'tracyWhitelistData' || $key == 'tracyLoginUrl' ) continue; $session_oc++; try { if (is_object($value)) $value = (string)$value; } catch (\Throwable $th) { try { $value = json_encode($value); } catch (\Throwable $th) { $value = $th->getMessage(); } } if (is_array($value)) $value = print_r($value, true); $session .= "<tr><td>" . $this->wire('sanitizer')->entities($key) . "</td><td><pre>" . $this->wire('sanitizer')->entities($value) . "</pre></td></tr>"; } $session .= $sectionEnd; } Not sure about this and when that code is used. But I think we can ignore this request. I've changed my code to save values as plain array in the session. The session is not meant to store any type of object, so it's ok if it breaks I guess?!
×
×
  • Create New...