Leaderboard
Popular Content
Showing content with the highest reputation on 08/23/2024 in all areas
-
This week the most useful core update is likely the refactored column width slider in the template editor, located Setup > Templates > [your template] > Basics > Fields. You may or may not already know that clicking, holding and dragging the percent indicator on the right side of each field adjusts the column width. With the term “column width”, I mean the width of the field in the page editor, for when you want to have multiple fields in different columns on the same row. It’s a convenient and time saving shortcut. But it was also a little tricky to use, as it allowed anything between 10% and 100% in 1% increments, and it was a little finicky trying to get the percentages just right sometimes. It’s something that’s been bugging me for awhile, and @Pete messaged me on Slack this week and mentioned it. He suggested making it operate in 5% increments rather than 1% increments. He also suggested making a double click of the percent indicator open up the dedicated column width range slider that allows for more precise adjustments. I thought those were good suggestions, so I went ahead and implemented them this week. In addition to now using 5% increments, it also supports the commonly used 33%, 34% and 66% width values as well. But if you happen to already have some field that is using a less common width, like 27% or 72%, etc., then it reverts back to 1% increments for the same behavior as before. Of course, you can also use the 1% increments by double clicking the percent indicator to open the dedicated column width range slider. Thanks Pete for the suggestions, I think it all works better now. I’ll be applying the same changes to FormBuilder’s equivalent of this feature as well. This week I’ve also been working on the new CustomFields modules (FieldtypeCustom and InputfieldCustom). Most recently I’ve been working on adding support for multi-language fields, as well as adding more examples and tools to make it really easy to use and configure. I may have it ready as soon as next week or the following week. The PageAutosave module is also getting a new version soon. I’ve been focused on the LivePreview feature of it and making a version of it that doesn’t depend on auto-save. The alternative LivePreview option (which we’ll just call “Preview”) will work anywhere because it has no field limitations. It simply updates the preview window whenever you save the page. While that’s not as fancy as live preview as-you-type, it’s still very helpful, while being reliable in any situation. It’s reliable and portable enough that I may end up putting the feature in the core, but will be testing it out in the next version of the PageAutosave module first. Have a great weekend!9 points
-
I became so used to use Template Field Widths that I almost always install it on larger projects. Super fast editing of values, tabbing around and done.3 points
-
Thanks, Ryan, for implementing that change, and Pete for making the suggestion! It's obviously not a huge headache, and the slider interface itself is a quicker and easier way to modify things rather than going into each field individually, but I too kept looking for a simpler option, so this is a nice change. I'm sure I'll more often use the double-click method moving forward (esp. since 33/33/33 looks weird, so I set things to 33/34/33 for thirds). With regard to the dedicated column width range slider, since there's no photo example of that in your post, does that also include a direct numeric input, or is it only a range slider? It may be nit-picky, but I think a numeric input might be even simpler/quicker. (Will you be using a <dialog> as the UI for that?) Either way, this is such a small and simple thing that will just make me smile, so your effort here will definitely not be wasted!! Have an awesome weekend.3 points
-
Just trying things! haha My thought was to have it all scoped within the page edit process, since Inputfield render could pontentialy happen all around? I have indeed done that hook you show buildFormContent() but in the current specific scenario the field is within a repeater so I cannot edit it on the main form. I think this is what I was looking for, fantastic! Although I see an interesting observation from @bernhard in that topic. Will give it a shot and come back! Thanks everyone!3 points
-
Great news, thank you @ryan! For FormBuilder, it will be a nice improvement. Even though it is a nice improvement for template fields and repeaters as well, I think I will still use @Robin S's visual aid: https://processwire.com/modules/template-field-widths/ Which is even faster to work with, as it provides a wireframe look, reducing the need to guess what the final layout will look like.2 points
-
Why do you add a hook inside the hook? Just grab the field and set the collapsed state: <?php $wire->addHookAfter("ProcessPageEdit::buildFormContent", function ($event) { $form = $event->return; $f = $form->get('some_field'); if($f) $f->collapsed = Inputfield::collapsedHidden; }); I think this should work. Note that I'm using addHookAfter, not before!2 points
-
Dear Spambot, Oh, how my heart flutters at the sight of your unsolicited message! Your offer of ngrok alternatives has me weak at the knees. But alas, our love can never be, for my heart belongs to ProcessWire. You see, while you're busy tunneling through firewalls, ProcessWire is tunneling straight into my developer soul. Its flexibility is more enticing than any port forwarding you could offer. Its API is smoother than your smoothest proxy connection. I'm afraid your alternatives just can't compete with ProcessWire's modules. They're the only plugins I need in my life. So farewell, my automated advertiser. May your packets find their way to greener pastures, for this forum is already in a committed relationship with the CMS of its dreams. Forever ProcessWired, Bernhard ?2 points
-
Ok... that looks really weird. First... make a backup, then... Check all installed admin themes, disable, and uninstall those you don't use. Stick with the default for now. Do you use any other modules that change styling and or behaviour in the backend?2 points
-
Ha, ok, I get it too, that wasn't a PW admin question. ?1 point
-
Indeed, after removing "count()" in this place the main page is displayed completely. In the other pages there are still bugs, I will look for next week - Thank you for your help!1 point
-
Thank you for the suggestion. Investigating further I have found out that PW has a useful trick up it's sleeve (as usual!). One can define a template named after an existing field by prepending the template name with field- e.g for the images field in my site, I made a template (without a file) called field-images and in that template I defined a new text field called imgDescription. Now every instance of an image also has a text field associated with like this: $image->imgDescription and this works as expected, for multiple images too. I think I will proceed with this as see how I get on... !1 point
-
OK I found a way to disable it, not necessarily the root of the problem though. I had the core module SystemNotifications installed and "Notification status" was turned on. I turned it off now and the issues disappeared. It's a core module, so is that the expected behaviour? Or is it a known bug? I'm reluctant to install it on other installations just to investigate it further…1 point
-
I also had to set the collapsed property dynamically and thankfully @Robin S has got us covered ? Just replace the hook to be on Field::getInpufield and it should work.1 point
-
@Ivan Gretsky As luck would have it, I do have ListerPro, and now the problem is solved. Thanks!1 point
-
OK, your screenshots don't look like plain UIKIT to me (what mine is set to). A few things to check ... First, check the Module->Configure for AdminTheme stuff. Make sure the right ones are installed and configured correctly. I think at least some of this is stored in the database, so deleting files and upgrade/downgrade stuff is going to miss what is in your database. Second, Have you tried opening the floating messages that are in the way in Chome's inspector (or Firefox, whatever). This will show you the CSS/JS in charge of positioning the elements. It will tell you what file it loaded those from, which tells you what files are the problem.1 point
-
1 point
-
1 point
-
I don’t pretend to have a good understanding of this stuff, but does the PW installer perhaps rely on output buffering to modify headers after starting the response body? Do the errors go away when you set this to 4096? Edit: I see this is exactly what the AI said. ignore me1 point
-
Clickbait title aside, I recently found a cool new feature in PHP 8.1 and wanted to share it with you, in case you didn't know this either. Starting with PHP 8.1 you can write $this->method(...) (yes, that's the actual syntax, not a placeholder) to reference a method. I find this super convenient, especially for defining hooks. Plus the IDE can refactor this much better than the traditional [$this, 'method'] callback. <?php class MyModule { public function init() { $this->addHookAfter('ProcessPageView::finished', $this->doSomething(...)); } private function doSomething(HookEvent $event) { // TODO: something } }1 point
-
Hi @AndreasWeinzierl! Got into same trouble. Fortunatelty, it can be fixed quite easily. Just uncomment //namespace ProcessWire; at the very beginning of the module. Have no guess why @kixe had commented it. Works fine after uncommenting, at least for me )1 point
-
For some inputfield visibility constants it is too late to set them at inputfield render. For Inputfield::collapsedHidden, Inputfield::collapsedNoLocked and Inputfield::collapsedYesLocked these are handled by the InputfieldWrapper class. I've found that a good method to hook for setting the visibility of fields in Page Edit is Field::getInputfield. This example is for /site/ready.php but easy to adapt to a module context: $wire->addHookAfter('Field::getInputfield', function(HookEvent $event) { // Only for ProcessPageEdit if($this->page->process !== 'ProcessPageEdit') return; $field = $event->object; $inputfield = $event->return; if($field->name == 'proj_code_folder') { $inputfield->collapsed = Inputfield::collapsedNoLocked; } });1 point