Jump to content

Craig

Members
  • Posts

    365
  • Joined

  • Last visited

  • Days Won

    6

Craig last won the day on February 2

Craig had the most liked content!

Profile Information

  • Gender
    Male
  • Location
    Gateshead, UK

Recent Profile Visitors

10,187 profile views

Craig's Achievements

Sr. Member

Sr. Member (5/6)

630

Reputation

14

Community Answers

  1. This is what I do, which is almost like (2). site/config.php: <?php namespace ProcessWire; if(!defined("PROCESSWIRE")) die(); // Other PW default config values... // ... $config->dbHost = 'localhost'; $config->dbName = 'example_site'; $config->dbUser = ''; $config->dbPass = ''; $config->dbPort = '3306'; $config->dbCharset = 'utf8mb4'; $config->dbEngine = 'InnoDB'; // Environment overwrite if (file_exists(__DIR__ . '/config.local.php')) { require_once(__DIR__ . '/config.local.php'); } config.local.php: <?php namespace ProcessWire; $config->dbUser = 'example_site_user'; $config->dbPass = 'example_user_pass_123456'; config.local.php is in .gitignore, so never committed, and separate config.local.php files exist on testing / live environments. (I use DeployHQ and this is added as a config file that gets deployed with the rest of the code). To me, the benefits of this approach means that the entire config can be changed depending on the environment, and used to turn things on or off, like debug or advanced mode.
  2. I'd like to add another vote to the notion of using something like htmx or Unpoly - I like them, a lot. Having used them on various projects, both have pros and cons (like most things) and satisfy different use cases. I know PW is quick, and the template caching improves on things, but I recently launched a site that made use of Unpoly's up-preload and up-instant functionality - the perceived speed of page loads makes it feel like a static site. The client's response on seeing the dev preview was "I was not expecting a like for like copy! Especially one that is that fast." (their emphasis; it was a redevelopment of a bad WordPress build). With Unpoly, I find the modal, popup and drawer UI are great. Having those integrated with the dynamic functionality is a plus, and means I don't have to worry about whichever underlying CSS framework is being used or pulling in a separate dependency to provide that. It's not perfect; some interactions, particularly nested ones, need a bit more care to make sure the server responses and front-end attributes are all present and correct. I also make heavy use of the "compiler" functionality. This is essentially your "$(document).ready()" equivalent which lets you initialise your client-side components (like maps or colour pickers, for example) on both initial page load as well as any time they happen to be added to the page dynamically via AJAX as the result of an Unpoly request. htmx sits at a bit of a lower level, and provides events and a plugin system to extend it and hook into different interactions. When you need to do client-side things, you will still need some javascript to get the job done; or you could use htmx's sister project _hyperscript. Either way, I'd be happy to see any of these become part of the PW admin. 🙂
  3. Hi Marcel! I think this is a small mistake in the module code. I'll release an update soon, but for now, you can change it manually as follows: In WayFathomAnalytics.module.php, at line 150, change it to this: private static function getEmbedConfig(array $data) (add the word 'static' after private).
  4. Hi Dan! I'm a part-time freelance PW developer (full-time employed elsewhere working on bespoke SaaS), based in the UK, and would be happy to take a look at the issues on the TKP site. Feel free to message me on the forum, or you can reach me on email: craig (@) onhover.co.uk.
  5. When processing a booking, you could include the current number of available spaces that the user was shown. Before finalising or saving the booking, you can check if the number sent through matches the current live value. If the live value is the same, and you have available spaces for the requested quantity, you are fine to decrease the amount. If the live value is lower, then someone else has grabbed them, so you can handle this situation as you please.
  6. I've got accounts with Fathom and Plausible, which are both great.
  7. Hi! I'd recommend doing it this way, using a single PHP DateTime object: <?php $date = new DateTime(); $days = []; while (count($days) < 7) { $days[] = $date->format('D'); $date->modify('-1 day'); } print_r($days); /* Array ( [0] => Tue [1] => Mon [2] => Sun [3] => Sat [4] => Fri [5] => Thu [6] => Wed ) */
  8. Fantastic site all-round and a great write-up here. Well done on the project, and thanks! 🙂
  9. I had a .me domain for an still-in-progress side project, but the high renewal price prompted me to look elsewhere. I ended up getting a .xyz for a much better price 🙂
  10. Unfortunately, PW only supports one dimension for arrays when using the API to process data. There's been some discussion on this topic at GitHub: https://github.com/processwire/processwire-issues/issues/387
  11. I've been using RunCloud for a couple of years now, both at work and for my own/clients use. I originally wanted to go with Ploi, but unfortunately the features I needed just weren't ready at the time, so have stuck with RunCloud. I'm also invested in using the RunCloud API to automate the setup of some projects, so there's that too. I have two wishes for RC, and that is that they introduce third party backup destinations (i.e. your own S3 buckets) and have fewer WordPress-only features.
  12. SSH and FTP won't be affected by .htaccess, as it's only the web server (Apache, usually) that processes the directives in that file. If it's failing, it could be due to the import tool trying to validate the web-accessible presence of the files it sees via SSH/FTP by making a typical web request (that is handled by Apache) - and it's those requests that PW could be blocking. Another reason could be if the directories it isn't finding is done by some sort of symlink, or there are some permission issues preventing it from working. Without any detailed logs or knowledge of the import tool, I can't suggest anything other than that! 🙂
  13. Craig

    Wireframe

    Like RockDatetime? 😉 Yeah - if it's mostly site-specific, I'd put it in a utility class. Multiple sites - probably a module 🙂
×
×
  • Create New...