-
Posts
4,032 -
Joined
-
Last visited
-
Days Won
66
Everything posted by Pete
-
@Mike Rockett is here a way to arbitrarily hook into the sitemap build process and exclude pages? I have a specific scenario where it would need to be a hook to skip pages, not a manual list or specific template.
-
Yes I was going to say there would be a lot of backspaces for core classes but you seem to have thought of that. I'll check this out as soon as I can - thanks! Any maintaining that many different versions - well done! I think that would break my brain ๐
-
It's only after a TracyDebugger upgrade it struggles, so it downloads the zip via the ProcessWire Upgrade module but because there are a lot of files in TracyDebugger the FileCompiler takes a while to scan and times out or runs out of memory (I forget which but timeout seems more likely). Only happens during upgrade but times out because of the network chatter (for want of a better phrase) with the EFS mount. And then it doesn't complete the upgrade basically so you have to do it via CLI. The reason for EFS in a clustered setup is that nodes (servers) in an auto-scaling group come and go as you refresh things or as the instances increase/decrease automatically in number due to traffic demands, so having the sites on local EBS on one node doesn't work at all as they'd need to maintain their own copies of all files in sync for the sites on that cluster. So in this setup you put the sites on EFS (essentially a very fast network drive) so all nodes in the cluster have apache run sites from there and it's definitely more than fast enough for normal operations, just slow for things like FileCompiler when there are a lot of files to check when compiling a module. It checks them all whether they individually have a namespace or not as it has to decide which ones need compiling so TracyDebugger with this many files makes it try and do "too much" (a relative term, I know) in this setup. I like the idea with the backwards compatibility, but is there not stuff in newer versions of Tracy that isn't compatible with PW 2.x now anyway? I don't remember if PW 2.x even supported PHP 8 - probably not much beyond that anyway - so there may be some benefit to a version that only works with 3.x at some point. Just that usually adding the namespace to modules is relatively painless (though I've had some occasions where it was a little less straightforward I'll admit ๐) and then it's one less bit of overhead when keeping modules up to date. A selfish request to be sure, but maybe I'm not the only one? ๐
-
Hi Adrian, My search-foo is weak today so this may have been discussed to death but I couldn't find anything specific. Is there a reason why TracyDebugger module isn't in the ProcessWire namespace? The reason I ask is it compiles otherwise when file compiler is on - which for me is most of the time as there are modules I use that are not in a namespace (I am now religiously disabling template compilation though - just a few years late to the party on that one ๐). On an AWS setup where the site files are on an EFS mount Tracy is the one module that can take ages as it's a little slower to do this on a network drive. I've even had the updater module in ProcessWire fail to update Tracy and often just do it via CLI and it seems to be entirely down to PW having to compile the module. I realise AWS setups like this may still be a bit niche in this day and age but now, having mastered AWS pretty thoroughly (auto-scaling groups - my last bit I really needed to learn - are amazing!), I wouldn't go back. Feel free to point me to where this has already been discussed - as I say my searches returned bits and pieces around namespaces but not this exact thing. (Also I've been away from these forums for too long so if anyone else likes to geek out about AWS setups maybe we can have a chat somewhere on the forums or maybe there's already one I'm missing. I miss 2012-14(ish) where I was on here every day).
-
Re. toggles I think the iOS way of doing toggles is the most understandable as lack of colour is "inactive" in this case and one colour for the "on" state - preferable not red, or if you do choose red as your primary theme colour at least a simple way to override that in CSS. I've not really looked at the new theme yet but do primary action buttons still have a separate class to secondary? I was quite used to overriding a bunch of stuff on the current admin theme - probably more than was intended - via admin.less so I'll have to take a peek at some point.
-
Something else to add - I think people maybe don't know things like this exist either. Not sure how best to explain it but since there's no metadata for SEO that would easily match "I lost my page data" with a module called "page edit restore" I'm not sure how easily people would find the module. Google obviously does a good job: https://www.google.com/search?q=processwire+module+to+prevent+data+loss&rlz=1C1ONGR_en-GBGB989GB989&oq=processwire+module+to+prevent+data+loss&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigAdIBCDUyMjBqMGoxqAIAsAIA&sourceid=chrome&ie=UTF-8 But if you type "data loss" into the search on ProcessWire it doesn't return this module (seems to return a lot of things other than that though). There's probably an argument there for someone to go through and add more search terms that don't necessarily relate to a category to make some modules easier to find I think. Any maybe based on my earlier thoughts, a way to categorise modules as suitable for specific types of site (article/blog etc) as well as by the usual categories.
-
@ryan I know you asked in the blog post about whether this should be in the core or not and there have only been two replies on the post and not much discussion aside from that (unless I missed a thread somewhere), I think it should go in the core. Like you said you only realise you need it when something goes wrong and recently a staff member lost an hour's work to some scenario or other. I've also done it myself from time to time but keep forgetting this module is here. In my opinion, if it's low overhead it should be in the core and turned on by default. If we're uncomfortable with the idea of modules being installed by default, perhaps the installer should make suggestions after installation - like "suggested modules for different types of site". Anything article/blog related should then suggest this module. I do forget certain modules exist too, like this one has existed for 2 years and I forgot. It would be lovely if the Modules part of the PW admin could be overhauled to easier find things from the directory by category or some sort of search like WP/Craft etc does it. Not saying their implementation is perfect but feels like it would take a little hassle out of it by making things searchable and 1-click installable from the PW admin. I'm sure others have discussed that in the past so maybe also a way to suggest features and vote for things too? The forum software can handle polls easily but I'm getting off topic now.
-
Perfect thank you!
-
Hi all, With CKEditor there was a way to have a stylesheet to change the style of things inside the editor. Is there a way of having a CSS file for that in for the TinyMCE fields? I know you can do some of this in the settings, but it's a bit restrictive when you want to use SVG and advanced CSS selectors. I have had a few occasions where clients want to have the styles in the editor match the site exactly and for some lists we've used SVG for list bullets etc and it's just easier to match up with a CSS file.
-
Ryan - it was great to meet you and Jan in person finally after 12 years ๐ That was a fantastic trip with a great group of people through some really interesting locations. We were pretty lucky with the weather too!
-
I think for mine what I'll need to do is a diff between the last unaltered source code I have and my code to play "spot the difference" then I can write it in a doc and send it to you. Some were improvements that might be beneficial to all, others were workarounds for very specific things... and others still were files written for you but only for my project so sounds like a bit of a nightmare to update without losing anything (hence why I've been putting it off if I'm honest). I'll need to get it done this month at any rate so I'll let you know. At least when I have the doc I'll also know what to check for on each update.
-
@kongondo I am still on 008 (well as you know somewhere between 8 and 9 ๐ ) - should I go through 009 to get to 010? I'm thinking probably yes - if it enables me to better understand all the changes with the amount of custom tweaks I have on my site and make sure they all get re-applied.
-
New blog post: Introducing the Custom Fields Module
Pete replied to ryan's topic in News & Announcements
Sounds and looks fantastic. -
Ah man I know what you mean - a long time ago (2012-14 maybe) I was here daily and I probably need to hang around here using the time I normally waste reading the news which is way less healthy for my brain. Or tapping away on other nonsense on my phone for hours.
-
I think you're right, and some things like Robin's module there are definitely things that could benefit from being in the core as it just makes sense - @ryan please do take a look at this one as it's incredibly useful to visually see how the fields will flow as well as in tabs etc and would be nice if it was in the core too as I don't think it would add much to it but add a lot of benefit to folks who launch sites regularly. This is a bit of a tangent but talking about mental health is less taboo nowadays and I'm sure someone else here will relate - having recently been diagnosed with ADHD I tend to let myself off the hook a bit more now with my forgetfulness. I used to beat myself up about it but the fact is that something needs to be deeply engrained into my day-to-day work to remember it so modules that might help me with setup at the start of a project like TemplateFieldWidths are long forgotten by the end of it ? It's also why I can write PHP and build big projects but cannot hang onto the terminology at all. Like people talk about closures and my brain can rarely remember what "operand" means some days but I can write it all... just the labels on my internal glossary/filing system aren't stuck on very well and keep falling off it feels like. I spent until I was 43 amazed at how people can learn stuff and retain the knowledge so well. I'm very thankful to be pretty good with computers and good enough as a developer that I can do this for a living and live pretty well.
- 15 replies
-
- 12
-
-
-
Ah so that's why this all felt so familiar! I remember using that one a while back on a site and then forgot all about it - thanks Robin for that one and to Ryan for improvements to the core field widths.
-
Ah yes and it's always fun when you migrate from WP to PW or any other ecommerce platform and have a million redirects to do for pointless tags from WP etc ? And even then you have to deal with the fact it used to be a WP site so bots are still always spamming old WP URLs and plugins trying to find a way in. Lots of fun.
-
Very nice! Only other thing I would add is maybe use hidpi variants on the PNGs too as my monitor is 1.5x normal DPI and they look a little fuzzy and possibly fuzzier still on fancier 4k screens. I enjoyed the honest pricing - it's been a bit of a journey these past few years to realise ecommerce often should start at that price point due to time involved. It's never particularly quick to set up and in my (limited) experience there will always be enough requests for stuff that's not "out of the box" to more than justify it. (Disclaimer: of course, pricing is different around the world but those figures didn't strike me as anything other than sensible).
-
It's actually sort of on the list for the projects we work on together Ryan, just I think the client is talking to me about it rather than give you another chunk of work to think about. Might be worth us discussing it next week.
-
So I had to do this one recently - develop a new theme on a busy site so the staff could test it out with their live data and the solution was to add this into site/init.php: if ($user->isLoggedIn() && $user->new_site_toggle == 1) { $config->urls->templates = "/site/tailwind/"; $config->paths->fieldTemplates = dirname(__DIR__) . "/site/tailwind/fields/"; $config->paths->templates = dirname(__DIR__) . $config->urls->tailwind; $modules->AdminThemeUikit->logoURL = 'site/tailwind/images/logo-white.svg'; $config->AdminThemeUikit = [ 'style' => '', 'recompile' => false, 'compress' => true, 'customCssFile' => '/site/assets/admin.css', 'customLessFiles' => ['/site/tailwind/styles/admin.less'], ]; } You might not need all that code but basically there was a checkbox field for certain users called "new_site_toggle" where they could login and toggle the new templates on and off and the template files just lived in /site/tailwind/ . "fieldTemplates" is for RepeaterMatrix template files in case anyone is wondering about that one. The Admin Theme config stuff at the end of my code above was just because I like to customise the colours etc in the admin theme, plus in this case it helped reinforce which version they were currently about to view on the frontend. I think I also added a toggle button and some jQuery to the frontend to make toggling whilst viewing the site a one-click process. Honestly the only problem with this approach was the new theme having different fields for some templates so old stuff had to live alongside new stuff, but as content was being updated all the time and I didn't really have time to do it any other way. In hindsight using some of Bernhard's modules would have helped as I ended up doing far too much dev on the live site instead of syncing changes ?
-
It doesn't come up all the time for me (depends on the site) but often enough that I agree with others that re-using images on other pages is important. I rarely insert them into the editor - that's my problem. How could we have an image from a different page's single/multi-image field be used in another page's single/multi image field because that's how I would need to use that feature? Maybe next to the upload button have another button to select existing from another page (or media manager - I like that idea) and it's inserted into that field as a reference and can have it's own description, tags etc. Likely others have already talked about this a lot over the years whereas I've just ignored it and duplicated my images quite a few times ? I think though that this is where storing images in folders by page ID would maybe need to be replaced with something else to uncouple them from page IDs on disk, like maybe files/field id/ instead though granted that would be complicated for an existing site with thousands of images already on it. They'd also need to be grouped under the field ID as on a travel website /files/photos (as an example) could have 10k files or a lot more with variations under it easily. Not sure that's actually a problem though - feels like it might have been 10 years ago but maybe it's not now. If you wanted though you could have a subfolder per image ID for that field to store it and all variations neatly which somewhat alleviates the issue.
-
I'll have a chat with some of the mods about what we do with it as I don't have time to manage it any more and it needs updating - has done for years.
-
Registrations on the forums have been temporarily disabled whilst we deal with a bot problem. Hopefully we'll be able to re-enable registrations later today.
-
So I tried this method but it still puts in the parameter if it's empty: I think the solution is to use the notes to convey what the default value will be if empty, but also have a way not to add it into the markup if it's empty - perhaps some sort of __omit_empty override, so default_term__omit_empty parameter since we don't want to make assumptions for everyone else using this already? That way for these specific cases I can also add a note warning them that if it's left empty it will defer to the defaults that can change over time so the content editor has had fair warning. EDIT again - my brain is not in gear today because I can simply do this myself and check for an empty value ? So this is a non-issue now - I can work with this easily by doing: if(strlen($default_term) === 0) { // use the default value in the PHP code } And using strlen because the value might actually be a zero of course. Edit #237: Here's my solution: Attributes: default_amount default_amount__notes=Leave blank to default to 150000 - default may be changed in future default_term default_term__notes=Leave blank to default to 25 years - default may be changed in future default_type default_type__type=select default_type__options=Repayment|Interest Only default_type__notes=Leave blank to default to Repayment default_rate default_rate__notes=Leave blank to default to 4% - default may be changed in future And defaults are now set in the PHP code, overridden with the HannaCode selections if any values are set <?php namespace ProcessWire; $types = ['Repayment' => 'repayment', 'Interest Only' => 'interest']; $default_amount = strlen($default_amount) > 0 ? $default_amount : 150000; $default_term = strlen($default_term) > 0 ? $default_term : 25; $default_type = strlen($default_type) > 0 ? $types[$default_type] : 'repayment'; $default_rate = strlen($default_rate) > 0 ? $default_rate : 4; echo $files->render('partials/calculators/mortgage', ['default_amount' => $default_amount, 'default_term' => $default_term, 'default_type' => $default_type, 'default_rate' => $default_rate]);
-
Neat, I missed that! @Robin S a very good point and I'm not sure what the solution is to be honest. EDIT: skip to next post. A few options: For some tags the easiest option is not to use the Hanna Code Dialog - maybe we could simply have an option to skip your module being used on a per-tag basis somehow? I've no idea how hard that would be but would solve the problem for this one but still allow it to work for other tags on the same site In the Hanna Code Dialog have the defaults set as placeholders instead of default values - that way if they aren't populated then they aren't used? I can simply set the defaults in the PHP code then. I think perhaps option 2 makes the most sense above - if a dialog option has no value entered simply don't add it into the tag markup. EDIT: @Robin S actually the obvious answer is to use parametername__notes and mention the default there and add the default values into the PHP code I think - I'll try that now.