Jump to content

Craig

Members
  • Posts

    371
  • Joined

  • Last visited

  • Days Won

    6

Craig last won the day on February 2 2021

Craig had the most liked content!

Profile Information

  • Gender
    Male
  • Location
    Newcastle upon Tyne, UK

Recent Profile Visitors

10,492 profile views

Craig's Achievements

Sr. Member

Sr. Member (5/6)

647

Reputation

14

Community Answers

  1. Sites like that with a small amount of content and low variety in page templates/designs are typically 10-20 hours for me.
  2. Well done on your first video! I can certainly appreciate the time that's gone into it, and has better quality than some others I've seen. I didn't watch all of it to the end (sorry) but I did feel that I got a good introduction to RockFrontend, and knew that if I wanted to fully utilise it on a project, I could watch it all to get a better idea of how to integrate it. Sometimes videos are great for showing how to use something in the context it's meant to, and to follow along all the steps; but I don't think videos are a complete replacement for READMEs or text-based documentation. I usually prefer shorter and more specific videos, rather than long ones covering a wider range of steps. As an example, I've recently watched a few videos on the BugBytes channel and feel they're about the right length and style (for me!), and they're usually 15-30 minutes. I don't have any advice on lighting or music, but the sound seems fine and clear to me ?
  3. I use https://github.com/spatie/url-signer for something similar.
  4. It looks like it's just DO that has poor performance on their managed DBs. I presume you've seen this thread - https://www.digitalocean.com/community/questions/managed-db-become-very-very-slow ? As a final test, you could match the DB machine size to the current server and try again, but I have a feeling it might not help much and there's a wider problem. If separating out your DB is the goal, perhaps running it on a separate VM might be more than enough.
  5. I never use themes, UiKit, or Tailwind; so it's a no for me ? Every site I build is different, and so the CSS, modules and code for each site is also different.
  6. I use Sublime Text as my editor. I've tried others, but haven't found anything close to Sublime in terms of usability and performance. Most PW projects use the following modules: ProFields FormBuilder Wireframe ProcessCacheControl AdminTemplateColumns Any additional PHP dependencies are added via Composer. I use Laravel Mix to handle front-end compilation / bundling of SCSS and JS. It's a nice "wrapper" around Webpack that simplifies this process a lot. (View one of my webpack.mix.js files that runs PurgeCSS for production builds) All code in Git repositories hosted on GitHub, and use Sublime Merge as a Git GUI. Hosting-wise, most PW sites are on a Krystal reseller account or a client's hosting (if you use referral code 'CRAIG' we share £20 equally). For new sites, I do set up staging/development versions as a subdomain so it can be previewed. For deployment, I use DeployHQ (referral link / normal link) (also by Krystal) - which handles the transfer of changed files from Git over to the hosting via SSH - either manually or on Git push. It also does the front-end build step and Composer package installation as well so I don't have to do that myself. During development, I disable the template cache with this in a ready.php hook. // (I also set `$config->env = 'development';` elsewhere) if ($this->config->env === 'development') { $this->addHookBefore('Page::render', function($event) { $args = $event->arguments(1); $args['allowCache'] = false; $event->setArgument(1, $args); }); } I recently posted about how I do separate configs for different environments.
  7. 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.
  8. 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. ?
  9. 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).
  10. 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.
  11. 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.
  12. I've got accounts with Fathom and Plausible, which are both great.
  13. 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 ) */
  14. Fantastic site all-round and a great write-up here. Well done on the project, and thanks! ?
×
×
  • Create New...