-
Posts
377 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Craig
-
Thanks for making this module! I've installed it on a development site along with RockGrid (for recurring events), but the RockGrid assets aren't loading. The styles and scripts are outputting paths instead of the URLs: <link type='text/css' href='C:\Users\Craig\Documents\Projects\Code\<site>\public_html\site\modules\RockGrid/lib/tabulator.min.css?v=3.0.241' rel='stylesheet' /> <link type='text/css' href='C:\Users\Craig\Documents\Projects\Code\<site>\public_html\site\modules\RockGrid/RockGrid.min.css?v=3.0.241' rel='stylesheet' /> <script type='text/javascript' src='C:\Users\Craig\Documents\Projects\Code\<site>\public_html\site\modules\RockGrid/lib/math.min.js?v=3.0.241'></script> <script type='text/javascript' src='C:\Users\Craig\Documents\Projects\Code\<site>\public_html\site\modules\RockGrid/lib/tabulator.min.js?v=3.0.241'></script> <script type='text/javascript' src='C:\Users\Craig\Documents\Projects\Code\<site>\public_html\site\modules\RockGrid/RockGrid.js?v=3.0.241'></script> <script type='text/javascript' src='C:\Users\Craig\Documents\Projects\Code\<site>\public_html\site\modules\RockGrid/scripts/buttons.js?v=3.0.241'></script> <script type='text/javascript' src='C:\Users\Craig\Documents\Projects\Code\<site>\public_html\site\modules\RockGrid/scripts/extensions.js?v=3.0.241'></script> I imagine this is due to the way the rockgrid->url() function works and because it's running on Windows but not 100% sure. Would you consider changing this? The RockCalendar assets load fine 🙂
-
WayFathomAnalytics - Fathom Analytics dashboard in your admin panel
Craig replied to Craig's topic in Modules/Plugins
Hi @Klenkes, sorry for the issue. I've just published a new version which should fix it. Please give that a go and let me know if it's worked. -
Current major server outage - advice please!
Craig replied to AAD Web Team's topic in General Support
There are a couple of things you could try in the PW admin area. The first option would be to find a template that has the 'Clear cache for entire site' setting (or enable it). Find a page that uses it, and Save it. The next option, if that doesn't work, is to find a page (or pages) with large files added to them. Download a copy of the original files, and then delete them from the page. (You can re-add them later once the issue is resolved). This might give you enough free space to gain access via SSH to clear the cache, or to install the ProcessCacheControl module which lets you clear it from within PW. Whatever you do, though, try to be quick, to avoid it filling back up again before you have time to intervene. -
Thanks @da²! Cookie expiration time issue has now been fixed and version 2.3.0 released.
-
How long does it take for you to build a website with PW?
Craig replied to Boost's topic in Getting Started
Sites like that with a small amount of content and low variety in page templates/designs are typically 10-20 hours for me. -
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 ?
-
I use https://github.com/spatie/url-signer for something similar.
-
PW 3.0.175 – Core updates: new DB scalability feature
Craig replied to ryan's topic in News & Announcements
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. -
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.
-
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.
- 66 replies
-
- 8
-
- developing
- working with pw
-
(and 1 more)
Tagged with:
-
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.
-
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. ?
-
WayFathomAnalytics - Fathom Analytics dashboard in your admin panel
Craig replied to Craig's topic in Modules/Plugins
Hi @Klenkes, thanks for letting me know! I'll have a look. -
WayFathomAnalytics - Fathom Analytics dashboard in your admin panel
Craig replied to Craig's topic in Modules/Plugins
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). -
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.
-
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.
-
What alternatives to Google Analytics do you use?
Craig replied to OrganizedFellow's topic in Dev Talk
I've got accounts with Fathom and Plausible, which are both great. -
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 ) */
-
Shetland.org | Welcome to the Islands of Opportunity
Craig replied to nbcommunication's topic in Showcase
Fantastic site all-round and a great write-up here. Well done on the project, and thanks! ? -
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 ?
-
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
-
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.
-
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! ?