Leaderboard
Popular Content
Showing content with the highest reputation on 10/14/2022 in all areas
-
With 2023 fast approaching, and CKEditor 4 having an EOL in 2023, I'm starting to feel a little pressure to get a plan in place. But is the replacement (CKEditor 5) the best path forward? https://processwire.com/blog/posts/reconsidering-the-ckeditor-5-upgrade/8 points
-
Thx for the screencast ? Can't you do a SHIFT+CLICK to select all from the first click until the last click?3 points
-
Wow thank you! Everyone helped a lot. This was great advice. Thanks to all of you, the problem is now solved. I was checking each of the things that all of you said, and this was very valuable because in some cases I uncovered some errors or problems that were unrelated to this issue but that needed to be fixed, so I fixed those as I went. So checking php logs, admin panel logs, and using debug = true in the config file turned out to be extremely helpful things to do. My site is simple, with only 1 extra module installed (the PW updating system), and no libraries or other code. So there were a limited number of places where the problem had to be, and I went carefully through the list of suggestions that all of you gave. The solution In the end, it was @pwiredthat came up with the correct idea - my template had an include for a non-existent file! I didn't notice it before and I had no idea it was non-existent, but when I looked carefully in each line for includes, sure enough there was no file of that name. Thank you pwired! And thank you also @Gideon Soand @flydev - your suggestions helped me identify other errors or problems with my site that I have now fixed. Thank you both! I was a bit surprised that in php 8.1 the include resulted in a 404 not found page, yet in php 8.0 the page was displayed properly (the bad include was ignored). The include was a little way down the rendering of the page, so I expected instead of 404 I would have gotten the top of my site rendering at least (everything above the include, such as the top menu etc). But I don't know much about the different versions of php so maybe 8.1 has a different way of dealing with this. Certainly I should have never written code with an include to a non-existent file! ? It was not at all intentional, I removed the file of the include at some point but forgot to delete all references to it in the template file. I will update the title to mark this problem as solved. Thanks again everyone! I couldn't have done it without you, I didn't even know where to start.3 points
-
Maybe it's an intentional lack to be sure and to double check the deleting of the fields from a template. But when developing new sites from older one, for me it's usefull to delete lot of fields quickly. Some times templates needs to be cleaned from lots of fields, so for me it's bit annoying to check all fields one by one (for many templates). I wrote few line of js and loaded them in admin side to have a global checkbox to check all the others for fields removal. Maybe somebody here could consider to implement this feature in the template ui (obviously, in a much more elegant way than mine ? ) My code has a very basic behaviour, without the full range of control (just select/unselect all and uncheck when removing one from all checked ones) $(document).ready(function(){ // Only when selected fields to be removed are more than 1 if ($('input[id*="Inputfield_remove_fields_"]').length > 1){ // get fields list to delete and add a global checkbox $('li.Inputfield_remove_fields ul.InputfieldCheckboxesStacked').append('<li><div style="margin-top:20px;"><b><label><input type="checkbox" name="select_all" class="uk-checkbox"><span id="select_all_label" class="pw-no-select">Select All</span></label></b></div></li>'); // some basic logics on checkbox change trigger $('input[name="select_all"]').change(function(){ if ($(this).is(':checked')){ $('input[id*="Inputfield_remove_fields_"]').prop('checked', true); $('span#select_all_label').text('Unselect All'); } else { $('input[id*="Inputfield_remove_fields_"]').prop('checked', false); $('span#select_all_label').text('Select All'); } }) // additional basic logic on field checkboxes uncheck $('input[id*="Inputfield_remove_fields_"]').change(function(){ $('input[name="select_all"]').prop('checked', false); $('span#select_all_label').text('Select All'); }); } }); Then this code has to be loaded in admin.php, as usual after the load of JqueryCore (tanks @Soma http://soma.urlich.ch/posts/custom-js-in-processwire-admin/ ) $config->scripts->add($config->urls->templates . "YOUR_PREFERRED_DIRECTORY/YOUR_FILENAME.js"); Hope it could be useful or for inspiring. A little screencast:2 points
-
Loving it ? You can't do that ? What is it? https://github.com/quilljs/quill ? https://github.com/summernote/summernote/ ? Also, some insights on that part would be especially interesting ? Fingers crossed for a smooth transition! Thx for all your great work!!2 points
-
If you're looking for a generic catch-all solution, there's one approach that I can think of: hooking before WireMail::send and checking if $event->object->bodyHTML is empty but $event->object->body filled, in which case you could generate the "bodyHTML" property based on the "body" property. I've never tried this, but at least this is where I'd start. Looking at ProcessForgotPassword code, there's no obvious way (config setting, hook, etc.) to make it send all messages as HTML, and I would assume that same applies to various other core (and non-core) modules as well, so your best bet is to hook directly into the class responsible for sending the message(s). Basically something like this: wire()->addHookBefore('WireMail::send', function(HookEvent $event) { if ($event->object->body && !$event->object->bodyHTML) { $event->replace = true; wireMail( $event->object->to, $event->object->from, $event->object->subject, $event->object->body, "<p>" . nl2br($event->object->body) . "</p>" ); } });2 points
-
2 points
-
Hi @bernhard, Honestly, I find the way in which browsers actually implement srcset and sizes to be really confusing. In the previous PageimageSrcset I included a bit of javascript for debugging, as I found it was sometime difficult to even tell which image was being used (if they were just different width variations). What complicates debugging is that the browser will use the largest image it has in the cache, so if you've loaded the page at desktop width and then try to see how it'll respond at a smaller screen size, it will still display the larger image. What happens if you add 1280 2x into the set? Cheers, Chris2 points
-
@Pixrael I have in the past, though they've never had a compatible license. They make great stuff. But for things like this I tend to stick to things that have a GitHub repo and compatible license. I've always seen Redactor as something that would be good for a 3rd party module rather than a core inclusion.1 point
-
Just to get this right... does your folder structure within your hosting look like this? If so... that's NOT how you do it. Each domain and (almost) all subdomains should have their very own folder. A bit more like this: There should be a tool or config where you can map domains and sub-domains to their very own folder. Otherwise you will almost always have issues. Your ProcessWire on www.mydomain.tld isn't able to change behaviour of matomo.mydomain.tld UNLESS you mix it up like in the first screenshot.1 point
-
I'd say the "How to do it" is your personal preference. Using breakpoints, JavaScript a mix of both, whatever fit's your needs and tools. The way more important part or question is or should be: Which parts of the navigation need to be visible at what point and at which position? I say that because on a personal blog you can do whatever you want while noone really cares. They know they are on a blog and they most likely will find what they are looking for. On the other hand there are lots of patterns (already burned into the users brains) people look for. A shop is totally different in terms of navigaton than a wiki. A restaurant has totally different focus than an insurance company. Look up all the big online shops. In terms of navigation, search inputs, browsing... they are almost exactly the same. Either due to those patterns or because they all use the same framework/components (for example: Shopify). Sure there are fancy ones but those only speak to a small audience that's looking for a specific item or experience and don't just browse to spend money. Compare websites from big players and brands to your clients. People know clicking the top-left logo brings them back to the homepage, while the top-right ☰ means there is menu when clicking. Each niche and type of website has it's very own patterns, behaviours and things people look for. Maybe that's a better thing to focus on. And don't forget to have fallbacks for those without javascript, using screen-readers or keyboard-driven navigation. Accessibility is a huge part here. (I'm guilty on this one but I'm working on it.)1 point
-
Yeah I agree it's quite a hidden feature. Similar to the double-click-delete on files/images... I think there has been some discussion about it some time. Maybe it was a github request, don't know ? But a note would certainly not hurt here ?1 point
-
@kongondo THANKS ! I spent so much time, I don't know how I didn't see this. !!1 point
-
When you look at the "_uikit.php" file at line 822, it's this code snippet: $categories = $page->get('categories')->each($categoryIcon . "<a class='uk-button uk-button-text' href='{url}'>{title}</a> " ); PW is looking for a "categories" field (page reference or something?) on your page (or template ? ), and apparently you don't have that or it's not filled in ("Call to a member function each() on null")1 point
-
1 point
-
Hi, this occured when i was running an old version of processwire. Simply deinstall the module, update processwire and then you should be good.0 points