cwsoft
Members-
Posts
167 -
Joined
-
Last visited
-
Days Won
3
Everything posted by cwsoft
-
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 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. -
I am developing on XAMPP too. Just added a little condition in my .htaccess, detecting if I am on localhost or live. When live, I redirect all request to non www with https. On localhost, I just use http. Only thing you need to remember, is that you can‘t set PW to force admin login to use https, as this would break login on localhost. Even wrote a small tutorial dealing with basic auth and https a while ago .
- 13 replies
-
- htaccess
- htaccess redirects
-
(and 2 more)
Tagged with:
-
@netcarverThanks for the link. Yes guess Database and WireRandom are both good places to learn about the code used to hash and set the user passwords in PW.
-
Hi, can someone point me to the code base where user->pass property respective the user->save method is defined in code? I would like to study the PW password hashing and storing a bit more in detail. From what I read in the core User/Users/Page classes, the user->pass prop will be automatically hashed when the user object is saved. I would like to investigate exactly that code which fires up when saving the hashed version of the unhashed password set via the user->pass prop. Any hint or link to the relevant code base in the Github repo would be highly appreciated. Cheer
-
I don‘t use jQuery in the frontend, unless I want/need to use a third party plugin, which uses jQuery as dependency. One of those repeating plugins I use quite often on the frontend for convenience is DataTables. Whenever I output structured data as data table on the frontend with more than 20 row (tr), I almost always make this table sortable by columns and filterable (only show matching rows) via this plugin. Simply to give the frontend user some intuitive options to quickly narrow down the relevant data. DataTables is powerful, well customizable and well tested. Of course I could implement that stuff with vanilla JS myself. However my next customer needs another feature I would need to manually add, where with DataTables I just switch of stuff I don‘t need for a specific customer via a simple config array (e.g. disable pagination, sorting, filtering, showing detail infos etc.). Same is for font awesome, CSS grids and so on. If I only need a handfull icons, I just go with png files or UTF8 code points instead of the full blown fa-suite. If I just want to collapse some paragraphs like an accordion, I normally go with some handmade vanilla TS/JS and SASS/CSS3. But if I need to spend lot‘s of time writing TS/JS for more serious work already supported by a jQuery plugin like DataTables, I don‘t spend too much time to reinvent the wheel and just go with the jQuery Plugin. Image sliders, hero headers etc. would be examples for using jQuery too. The best part of ProcessWire is, that Ryan give us all the freedom and options to use whatever we would like to use for a specific project in the Frontend with no predefined framework (like Bootstrap) one would need to use by design.
-
Than I let it unchanged ?
-
@rastographicsBreaking HTML templates into blocks, sections or partial files is what Latte supports out of the bocks. Details see https://latte.nette.org/en/template-inheritance. Maybe you can a small writeup of your approach with htmx an PW once you made your way through.
-
@rastographicsYou can find some additional infos in this post here. Meanwhile I used the 2nd approach shown in the linked tutorial with a slightly modified setup (e.g. proper namespaces, use statements, method names etc.) to implement Latte template engine in all my new projects so far. For Latte I would go with official Latte documentation linked above. In addition I would read the Custom Page Classes tutorial linked and watch Bernhards video. Then I would start off with a first project and use normal PW template files (like a controller), loading the required latte template (view) and implement my page specific methods via custom page classes. Nice part is, that you can call the specific page methods via {$page->myAwesomeMethod()} in Latte view too.
-
How to protect files from being downloaded directly via url
cwsoft replied to hintraeger's topic in API & Templates
Have you tried Content-Type: application/pdf (with space after colon)? Does it work with PW if you remove the .htaccess file? Have you tried different PDF and different browsers too?