-
Posts
6,629 -
Joined
-
Last visited
-
Days Won
358
Everything posted by bernhard
-
Maybe you want to give (Rock)Migrations a try ? I usually just do a git pull (and modules refresh) and that's it. But as I said (or tried to), that's not the problem. The problem is that I have 3 machines that I want to use for development and all should have the same experience with no effort. That could work when the environment is centralized. But maybe I want too much...
-
Sorry for hijacking this thread, but it could also be an intersting topic for you guys as it is a different approach that we could use for our development on Windows (and I'd need help to make it work):
-
Hello everybody! I'm trying and trying and can't seem to get this working. I've recently been evaluating different cloud providers and while playing around with all this fancy, scalable, flexible (and quite cheap!) cloud stuff I thought, "what if I created an Ubuntu dev server for all my web development?". That's nothing new, you might think, and you are partly right, because that's what we are all doing with our live servers. BUT: I wanted to access the whole dev server remotely with a GUI, so that I can install and use VSCode directly on the server. That would have major benefits to my current setup (local Win10 laragon + VSCode). The pains: I have to keep VSCode in sync between different machines (Desktop, Laptop, weekend home) I need to take care of backups When I share work with clients my PC has to be turned on (ngrok) It's a windows system and not always behaving same as my linux live server Slooooooow internet connection at my weekend home in the mountains... That would all be solved if I could move my dev environment to the cloud. Of course, I'd need an internet connection (so it wouldn't work that great in a train/airplane), but that's fine I guess. Currently I'm using a VSCode extension to map remote file systems via SSH into the IDE. That works great for little edits, but it has three major drawbacks: I still need to keep different VSCode installations in sync (themes, settings, extensions, php path variables etc... you know all that) I don't have a "search in files" feature, which is VERY important for my work I don't have code intellisense available for the project, which is also very important That's why I thought: Why not use something like a remote desktop, install a desktop on the Ubuntu server and use it from wherever I want, always with my common settings and highspeed internet. I failed ? I'm not good at linux, so maybe it was my fault, but I could not get a remote connection working properly via xrdp/rdp. Via teamviewer I got only 800x600 screen resolution (was not able to change that) and the commercial license is too expensive. Also VNC did not seem to be a good option (didn't try that, though). Then a friend of mine mentioned X11-forwarding and a tool called MobaXterm. It's a tool where you can forward the program's execution from the host via SSH and display the GUI on the client. Awesome. Exactly what I'd need. Have a look at MobaXterm, it seems to be a great alternative to WinSCP or Putty or FileZilla. I managed to run the xclock program of the Ubuntu 18.04 host server on my Win10 client. Very nice! But unfortunately I couldn't get vscode to run ? error while loading shared libraries: libXtst.so.6: cannot open shared object file: No such file or directory I have no idea what that means. It seems that the X11 server I'm using on Windows does not work for vscode. I found this issue: https://github.com/Microsoft/vscode/issues/65232 where byates says: So it seems to be possible. Some comments seem to confirm that. But I don't know how to use MobaXterm with VcXsrc and I can't comment the issue on Github to get some help of those users ? Maybe some linux gurus here can help me with this problem? Maybe someone likes the idea of having a remove coding environment (also found https://coder.com/ ) and wants to try this himself? Especially the VSCode Users on Windows? @kongondo Thank you! PS: This video shows what I'm talking about (using Putty: https://www.youtube.com/watch?v=NNuXpk10zXE )
-
Just found another nice tool for debugging rest apis: https://insomnia.rest/
-
Hm... Thinking a little more about it, I think having a setting "set checkbox to true by default for newly created pages" would be the best option. Changing the default setting during lifetime of your website is unlikely and if so, this setting would just impact newly created pages and there would not be the need for updating existing pages (as they already have the correct value, which was set manually at that time). It would be a very easy hook, as shown above: https://processwire.com/talk/topic/2199-checkbox-default-value/?tab=comments#comment-184564 Sorry for hijacking your thread robin and thanks for the discussion ?
- 4 replies
-
- 1
-
-
- module
- checked by default
-
(and 1 more)
Tagged with:
-
Thx Robin! ? @Gadgetto this might also be interesting for you. I still think having the value reversed and naming the field not_whatsoever is not the best solution (please don't take this as criticism!). Couldn't we create a new Fieldtype "CheckboxDefaultTrue" that extends the I've played around with this idea and I got this "far" ? <?php namespace ProcessWire; /** * ProcessWire Checkbox Fieldtype * * This Fieldtype stores an ON/OFF toggle via a single checkbox. The ON value is 1 and OFF value is 0. * * For documentation about the fields used in this class, please see: * /wire/core/Fieldtype.php * * ProcessWire 3.x, Copyright 2016 by Ryan Cramer * https://processwire.com * */ class FieldtypeCheckboxTrue extends FieldtypeCheckbox { public static function getModuleInfo() { return array( 'title' => 'CheckboxTrue', 'version' => 101, 'summary' => 'Same as core checkbox but defaults to true', ); } public function getBlankValue(Page $page, Field $field) { return 1; } public function sanitizeValue(Page $page, Field $field, $value) { return $value ? 1 : 0; } public function getMatchQuery($query, $table, $subfield, $operator, $value) { // need help here :) } } This seems to work, but I'd need help with the getMatchQuery. This way the checkbox stores "0" for every unchecked checkbox and NULL for every checked checkbox (which is the default): What do you think?
- 4 replies
-
- module
- checked by default
-
(and 1 more)
Tagged with:
-
Yeah, that's why I disabled it lately ? I think it also broke something else (ajax etc. getting more complicated when things are hidden at first...). But if done right, maybe it could improve the usability. Not sure ?
-
Are you talking about effects like the one above? I've once created a little module that shows a "loading" overlay animation until the page is fully loaded. Would that also be an option or are you talking about something else? Sorry, I'm not good at frontend stuff ?
-
Online shop for a local wine dealer with Padloper
bernhard replied to Stefanowitsch's topic in Showcase
I have not used Padloper yet, but I built a custom shop lately and it's a LOT of work ? The problem is not the payment integration, the problem is handling all the user interactions (shopping cart, taxes, product variations etc). So it depends a lot on your scenario. If you only want to collect donations without any other features, then you might not need padloper (but then you could also just use a payment button from one of the providers) -
Or just use $this->log('foo bar'); https://processwire.com/blog/posts/processwire-core-updates-2.5.15/#new-log-and-this-gt-log-text-api-functions
-
Hey Robin, I wonder what you think about this approach: This could also be packed in a module and I think the behaviour is a little bit easier to understand (checked is checked ? ). Maybe you tried something similar and found some drawbacks with this simple approach?
- 4 replies
-
- module
- checked by default
-
(and 1 more)
Tagged with:
-
What about this? $wire->addHookAfter("Pages::added", function($event) { $page = $event->arguments(0); // check for page template if necessary here $page->setAndSave('check', 1); }); PS: Did you see @Robin S module?
-
https://github.com/adrianbj/TracyDebugger/blob/master/TracyDebugger.module.php#L2736 Learn from the best ??
-
Maybe, but maybe not. It would be an easy fix on the PW side and maybe a not-so-easy fix for Intelephense. It should not have any drawbacks and maybe has other benefits as well (like correct syntax highlighting by default, especially if the editor does not support file extension mappings). It seems that newer modules are already using .module.php so it would just be consistent to always use .module.php ?
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
?? I'll file an issue on github. Let's see what ryan thinks of renaming all those files to module.php https://github.com/processwire/processwire-issues/issues/860
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
Anybody? Does it also not work for you guys?
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
Thx adrian, that does indeed take care of it! Thx. Agree that this should be accounted for!
-
Hm. Well - doing a modules refresh is also a fix, but I don't think that this is how it should work... Any other opinions?
-
I'd call that "everything" ?
-
Hi everybody ? Playing around with a new PW Project... I installed the blank profile + Tracy + AOS, nothing else. Then I enabled Language Support and installed @jens.martsch 's translations. I enabled the AOS lang switcher ( @tpr ) and changing language works all fine except the menu, which changes only after a modules refresh. I tested changing the language via the user's settings (not AOS) and it's the same. Did you ever realize the same problem? Or do you think that this is not a problem? I'd call this a bug, so if anybody confirms that I can file an issue on Github... Thx!
-
Markup Regions - conditional replacement of regions
bernhard replied to Gadgetto's topic in API & Templates
Don't see anything wrong with that ? -
Fatal error when outputting multiple page_reference fields
bernhard replied to Manuel's topic in API & Templates
Nice! ? On mobile, but you can even make it simpler by using 'moons' => $planet->planet_moons->each('title') See the API docs for WireArray. It has some nice features ? -
You are saying "parent" here, but according to your explanation you are not looking for the "parent" (in the PW meaning), but for the page containing the reference to istanbul, correct? Such things depend a lot on your setup of the page tree. This might be a good read: If you have a setup like this (I guess that's your setup?) /countries (tpl=countries) /countries/austria (tpl=country, referenced cities: vienna,salzburg) /countries/turkey (tpl=country, cities: istanbul, ankara) /cities (tpl=cities) /cities/vienna (tpl=city) /cities/salzburg /cities/istanbul /cities/ankara And you visit page "vienna" the selectors could be: $page; // vienna $country = $pages->findOne([ 'template' => 'country', 'cities' => $page, ]); $siblings = $country->cities("id!=$page"); But it might make more sense (or might not) to sturcture your pages like this: /countries (tpl=countries) /countries/austria (tpl=country) /countries/austria/vienna (tpl=city) /countries/austria/salzburg /countries/turkey /countries/turkey/ankara /countries/turkey/istanbul Then it would be: $page; // austria $country = $page->parent; $siblings = $page->siblings("id!=$page"); This setup would have the benefit, that you can never assign one city to two countries. Well - if that is what you need, the other approach could make more sense (https://en.wikipedia.org/wiki/List_of_divided_cities) @elabx s is also correct, but $page->id is actually not necessary, because when you put your $page variable in the selector string, it will automatically return the page id ? Other than that it's a matter of preferance if you use array syntax or not or if you use "id!=$page" or ->remove($page) ?
-
Thanks for bringing this to my attention @szabesz! My favourite: Best wishes to him, best wishes for ProcessWire and of course best wishes to you @cstevensjr and your project! ? PS: @cstevensjr is there a way how we can subscribe to new topics on your site?
-
Thx to @Robin S I realized that GitHub now also offers unlimited private Repos for free. In some discussion about it I found another interesting alternative (if you don't want to host private code on external servers): https://gitea.io/en-us/