
cwsoft
Members-
Posts
201 -
Joined
-
Last visited
-
Days Won
3
Everything posted by cwsoft
-
The PW forum is a place of the most friendly and helpful people I ever interacted with in web based CMS/CMF forums so far. What I learned from other forums is, that showing as much code you already tried (e.g. I put this code xxx into /site/templates/myfile.php) and asking a single question closely related to your code example (e.g. I expected to get x, but instead I see y) would help all involved people to better grasp each others standpoint and to provide better replies to specific questions. Cheers cwsoft
-
Nice and clean writeup on your local development setup. Thanks for sharing.
-
You need at least basic PHP skills and read through some ProcessWire tutorials before you could answer the question yourself. PW has a great community answering questions fast and trying to help and some great tutorials but less good out of the box frontend templates with a big wow effect for free. I would recommend to set up a local PW installation with a basic template first, read through the template, page, fields tutorials available and try to add some own templates e.g. showing some news extracted from child pages etc. PW has an easy API allowing to do amazing things, but you need some basic knowledge of PHP at least to have fun. Finally, you will never know if PW fits your needs unless you try to setup a small project with it and make your own mind out of it. No easy answer, sorry, but I would just try out myself and see what happens. Cheers cwsoft
-
Nice write up. Thanks for sharing.
-
As usual when I have a new idea and wonder how to implement it with PW core only, Bernhard has left a forum post pointing into the direction how to accomplish what I am looking for, even before I posted the question in the forum. I guess I own you a beer or two at least now.
-
Hi. I am using two site config files. The site/config-dev.php holds the DB settings and debug settings for my local site, the site/config.php holds all the settings for the live site. PW checks for presence of a config-dev.php and uses this file instead of default site/config.php if it exists. On my local dev setup, I do have a config-dev.php file next to my site/config.php file. On the live server I just upload the site/config.php or delete/rename the site/config-dev.php via FTP. Then I just ZIP my entire local setup once I am finished, upload the ZIP via FTP into the root of my live server together with an PHP unzip file and then visit the URL of the unzip script on my live server in the browser. The unzip scripts extracts all the files, sets right permissions if needed and deletes the ZIP folder and the unzip script itself once done. The local DB dump is done via DDEV DB export feature and then just loaded to the live server via phpMyAdmin or whatever DB tools the hosting company offers. This is done before I upload the ZIP file to my live server. For some extra safety, I create a dump of the live DB and rename the live site/ and wire/ folders to site.bak/ and wire.bak/ via Ftp before doing the update. This way I can easily revert back to the last working live state if needed - never needed for my PW sites so far, but happened in the past with some WP sites I tried to update.
-
@dan222You can get working a project in mind with PW quite easily by just using some basic features. I learn and discover new things every time I am using PW or read forum threads even after one year of using PW. Pretty sure I discovered only 30-50% of PWs goodies yet.
-
I created regular user accounts via the PW API with a specific role. Then I build a frontend login form using the PW API with the build in login throttle module and added a hidden honey pot field and a simple number captcha. Doing so allows to not expose the true admin login URL, which I keep for the side admin and two maintenance accounts. The admin template checks for the roles and throws a 404 PW error if a user with the role of the frontend-user would try to enter any backend page. So for those frontend users it seems the PW admin backend does not exist at all, while the site admin or the two other accounts can enter the PW backend parts which are accessible based on their roles and permissions granted.
-
Hi, still sounds doable with plain PW to me. I would go with a frontend login to allow users to login to protected areas of the website frontend from where they could add pets via templates or module logic. Would limit the users to just see the frontend parts they need without beeing able to enter the backend. Did something like this with up to 10.000 users for a kind of booking portal.
-
The learning curve and time depends on your definition of a „decent standard“ for your local development environment and operating system used. For example. I bought a new Windows 11 Laptop recently and just wanted to upgrade my dev environment I used for about 10 years now (Windows 10, XAMPP, VS Code with several Addons) to a decent standard on Windows, which is WSL2 (Windows Subsystem for Linux), DDEV (replacing XAMPP), and installing all the stuff previously hosted on Windows in the WSL2/Ubuntu env co-existing with Windows 11. This took me about 5 days until I get used to Docker/DDEV stuff etc. When I first tried Processwire a year ago with a specific project (event booking system for 1-10 departments with 1.000 users/department) in mind, where I didn‘t want to implement authentification, logging, permissions, database queries in vanilla PHP myself, it took me a weekend to go from project idea to a working demo for one department with my existing PHP knowledge (last PHP project was in 2018). I just installed a default site template with delayed output strategy, read me through the API and tutorials and asked questions in the forums and the demo turned into pilot tests after about 2 weeks and went live with three departments after 4 weeks. Up to that time I wrote three modules (two publicly available from the PW module store) and one backend module for private use. So to recap. If you just use your existing local dev env, you can get results fairly quick using the PW API and the snippets in the tutorials. Another great resource are the code comments in the PW core files on Github. If you want to upgrade your local dev env to some decent/recent setup, it will take somewhat longer. The extra time I spend with setting up my local dev env amortized about 1-2 weeks later, due to the better workflows and toolchain like DDEV/WSL2, which I won‘t miss anymore. Cheers cwsoft
-
External supporting PHP (or Bash) scripts best practice?
cwsoft replied to Jonathan Lahijani's topic in General Support
I check permission (e.g. superuser) in the php script, use .htaccess folder protection and use get parameters to hide/redirect (404) non privileged users depending on how powerful the script is or what damage it may do in untrusted users hands. If in doubt, I create an admin module or upload the script only for the time required (with the measures above) and remove it afterwards via FTP. -
MySQL 8 compatibility and MariaDB replacements
cwsoft replied to MoritzLost's topic in General Support
Have recognized the speed increase with a MariaDB / InnoDB project set up too. Never investigated further, why it feels much more responsive than comparable setups w/o InnoDB so far. -
Just to check. There is no forgotten config-dev.php around with different settings? Have you cleared out all sessions and cookies via browser dev tools?
-
Support for config-localhost.php file (or similar)
cwsoft replied to Lance O.'s topic in Wishlist & Roadmap
@ArklogicFor actual PW versions, just put your live config settings into config.php and your local development settings into config-dev.php and don‘t upload the dev config to your live site. This works quite well for small sites/teams. In config-dev.php you could use plain PHP to read from .env or add switches to reflect different stages based on a variable, flag etc. -
Please check if you have a page item added twice in your PageArray after the add operation. Had a similar issue with sorting in one of my projects due to one page item added twice as result of an add call. Just output the PageArray e.g. with Tracy dump methods for a quick check. If there are duplicated page items, PageArray is sorted by page ids by default. See this thread for additional infos.
-
Sure. You just need to register some event handler using vanilla Javascript or jQuery shipping with Processwire. Easiest way would be to simulate a mouse click on the left right HTML elements of your existing gallery when the arrow keys are pressed. Some inspiration can be found here for example.
-
Fun fact. Creating a local backup of a live Wordpress site was easier with DDEV too. MySQL and PHP versions can easily be set in .ddev/config.yml to match the LIVE versions. Adding a POST import-db hook automatically replaces the hardcoded site URLs in the database.sql dump to match the URL on my localhost when running ddev import-db —file=database.sql.
-
@bernhard: Thanks to your forum thread, I finally did the switch from my previously used XAMPP development stack to WSL2/DDEV on my Windows 11 machine. Now I do all my Python, PHP and Node/Html projects within the Linux subsystem on Windows 11 using VS Code as my editor of choice. Only Windows Desktop C# projects (WinForms, WPF) are still done on the Windows side using Visual Studio 2022. Always wanted SSL certificates on my localhost. Installation was easy and my first project was set up within minutes by simply cloning and importing my MySQL dump into my ddev container. Thanks for the inspiration.
-
Hi, Contao (fka TypoLight) is somewhat close to ProcessWire from the Field, Template, Page point of view. However it lacks (at least when I last revisited it) from a powerful ProcessWire like API. This and the all objects are „pages“ approach are unique to PW from my point of view. Only thing I somewhat miss in PW is a global media/assets manager, but there may be a module someday. The easy to use PW-API makes the main difference for me and is the reason I ended up using PW for my latest projects.
-
Nice write up. Found out about Custom Page classes and Latte after I prototyped my first project with Processwire. Both items help to improve the code structure and keep everything where it belongs to. And thanks to your post, I stumbled over PageTableNext, which seems exactly what I need for another project in the pipeline. After getting used to (and remember) the excellent API and the possibilities offered by Hooks (e.g. to modify the admin page tree based on user roles), I really enjoy to create projects with Processwire so far.
-
Limit the amount of products a user can purchase
cwsoft replied to Spinbox's topic in ProcessWire Commerce (Padloper) Support
Sorry didn‘t get the module specific part on my iPhone display. Deleted my old message as it was out of context. -
You have a field on a template which shows the default text. Than on page 1 and 2 you are fine with the default text, but for page 3 you change it to whatever you want via backend admin. Hence one field with default text and one single template, which is used by three pages in my example. The default text can be overwritten on specific pages and kept unchanged on the other pages.
-
[SOLVED] How to get the next monday of the next monday
cwsoft replied to Sten's topic in General Support
Sorry. Just typed from my mobile out of my head to point you to a possible PHP solution using strtotime. From here one could check the PHP documentation for https://www.php.net/manual/de/function.strtotime.php, providing some examples combining different time offsets as text string. -
[SOLVED] How to get the next monday of the next monday
cwsoft replied to Sten's topic in General Support
Have you tried „+ 14 days“ as second parameter? This at least works with PHP strtotime method.