Jump to content

szabesz

Members
  • Posts

    2,726
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by szabesz

  1. Hello, Probably, it is the find() or a "similar method" (which also begins with the word find) is the one which you should use, not get(), see: https://processwire.com/api/ref/pages/ $pages->get() : Returns the first page matching the given selector with no exclusions. Meaning with get() you get one page only without checking any kind of status nor access control.
  2. Thanks Adrian! I simply postponed upgrading the module. Next time I work on that site, I will surely try to upgrade it base on the info you provided above.
  3. Quite agree! Personally I never implement anything relying on CDN because of the possible issues with external dependencies.
  4. I quite understand it, so please simply forget my question if such a task would add any considerable amount of time to the maintenance of the module. I just saw that in your Admin Actions module the Ace editor files add up to only about 1MB, and I simply use Ace in these modules the way they are configured by default, and I will highly probably never be interested in more than that. So to me, what is not used is just "ballast". Looks like the distribution directory of this editor is about the same size as Ace's (maybe even a bit bigger) and if so, it might not be an answer to the "issue". Also, (quote) "The Monaco editor is not supported in mobile browsers or mobile web frameworks." which is not an issue to me as I never use the ProcessWire admin on a mobile, so I do not even know if Ace supports that or not.
  5. Hi, You could hook after "InputfieldText::processInput". That way you can also check for the uniquness of the name/title if you need to, and add your error messages as needed. Here is a similar hook I use in a project: <?php namespace ProcessWire; wire()->addHookAfter("InputfieldText::processInput", function ($event) { /* @var $page AddonPage */ $field = $event->object; if ($field->name == "suffix") { $page = modules()->ProcessPageEdit->getPage(); if ($page->template != "addon") return; //The final title and name is based on the fields: addon_addon + suffix (both are text fields) $suffix = $field->value; $suffixFormatted = " (" . $field->value . ")"; $addon = session()->get('addon_addon'); session()->remove('addon_addon'); $titleNew = empty($suffix) ? $addon : $addon . $suffixFormatted; $nameNew = wire()->sanitizer->pageName($titleNew, true); $uniqueName = pages()->names()->uniquePageName($nameNew, $page); $titleSelector = wire()->sanitizer->selectorValue($titleNew); $existingPage = wire()->pages->get("template=addon, title={$titleSelector}"); $hasErrors = empty($addon); if ($existingPage->id == $page->id && !$hasErrors) { //bd("Page name has not changed, he have no errors, so no need to proceed..."); return; } if ($existingPage->id != 0 || $hasErrors) { //bd("We had errors, we need to clean things up..."); $titleUntitled = "addon-" . date("YmdHis"); $nameUntitled = wire()->sanitizer->pageName($titleUntitled, true); $uniqueNameUntitled = pages()->names()->uniquePageName($nameUntitled, $page); $page->name = $uniqueNameUntitled; $page->title = $titleUntitled; $page->addon = $addon; if ($hasErrors) { session()->error("Errors listed below must be fixed for this add-on to be saved properly!"); } else { session()->error("Title is already in use by an existing one (ID '{$existingPage->id}'). Either change the Label and/or add a unique suffix!"); } } else { //bd("No errors, We can save provided values..."); $page->title = $titleNew; $page->name = $uniqueName; } } }); Note that the admin "new page creation process" skips the step asking for the title in the first place, so I had to handle the case of blank values as well when the user abandons the complete process of creating a page with the required text fields being filled in and saved.
  6. Happy new year to all! @adrian My question is in the title :) The ace-editor folder is ~11.7MB with ~444 files, along with snippets, themes and such. Personally, I do not think I/we need them all. Would it be possible to make it a lot slimmer somehow? cheers, Szabesz
  7. Your list is exactly what I wish for as well, I have nothing to add. I gave it a thumbs-up. Ryan's time to work on ProcessWire is limited and being the only one to stear the boat, naturally, he needs to prioritize. I think the most important issue with implementing and maintaining migrations is that it is a HUGE effort, and Ryan would need to add support for his Pro modules as well. Again, he only has 24 hours a day. I cannot even imagine who would have the time to rewrite the admin theme from scratch. However, if Ryan ever wants to move it forward to the next level, he needs to move his mindset to the reactive era, probably HTMX + Alpine.js. If we drop support for the others, people would surely use AdminThemeUikit :P
  8. I'm in! Maintaining AOS would be just too much work for even the most experienced, I think, so no wonder @tpr is no longer interested in it, especially that he no longer uses ProcessWire. Also, AOS mostly supports the Default or Reno admin themes which we should deprecate, IMHO.
  9. Still implementing pages is essential, I think. Thanks for the addition.
  10. Thanx @gebeer for sharing! As a side note, anyone implementing infinite scroll, be aware that a simple and basic implementation can lead to very bad UX, see for example: https://builtin.com/ux-design/infinite-scroll So it is a lot of work to implement it from scratch if one wants to provide something that is not pita for the user.
  11. It is surely not "actively" maintained. The question is, will it ever be maintained at all?
  12. That's an interesting idea indeed. I'm not sure how that could be implemented in practice but the possibility to switch compatible Inpufileds on the fly sounds powerful enough on its own. Maybe this request is related in some regard: https://github.com/processwire/processwire-requests/issues/470 This often happens, especially when fixing client's work done in the RTE. Maybe TinyMCE 6 is a lot better than CKEditor was, so fixing things will be less frequent in the future but when the HTML source is long and complex then a plain text HTML input is hard to work with. Also, I often like "experimenting" with the HTML source and that is another use case, I think.
  13. As a starting point, I guess, as they look outdated to me but I have not tried... Anyway, I think an officially supported "advanced" code editor plugin would be beneficial to all of us.
  14. Thank you for all the hard work you put into migrating PW to TinyMCE 6, which is so much better than CKEditor. One thing I'm still longing for is a "proper" source code editor which is a paid addon, unfortunately. Would it be possible for you to implement a TinyMCE code editor for ProcessWire, based on CodeMirror or similar?
  15. Not too much spare time either but if I have some, I will look into that. No promises though. Thanks anyway! As you can see, links do not appear when editing user pages. And it is not just for the user's name field but all the other additional fields I have added to the User template. (And the template edit link is missing too). It is probably because ProcessWire treats users differently from regular pages.
  16. I agree. AI has nothing to do with computer's being intelligent or being able to do something on their own without human aid and intervention. Oxford dictionary for the word "intelligence": "the ability to acquire and apply knowledge and skills" A bunch of data in a database is not knowledge. What is in a human's head, that is "knowledge". Again, the Oxford dictionary says: knowledge: "information, and skills acquired by a person through experience or education; the theoretical or practical understanding of a subject" skill: "the ability to do something well; expertise" "artificial" by the dictionary: "made or produced by human beings rather than occurring naturally" Artificial Intelligence by the same dictionary: "the theory and development of computer systems able to perform tasks normally requiring human intelligence" So how could one eliminate the "human" form Artificial Intelligence which – by definition – is strictly related to human beings? If we start using words and expressions which can also mean the opposite as well (or something else completely) then we instantly loose our ability to communicate. (That would be like on-the-fly redefining the commands and responses of a protocol in a computer system. The result would be a complete mess.)
  17. Thanks! I've added my thumbs-up but where are the others? ;)
  18. Another factor is the user's personal preference. For example, when adding products to a cart in a webshop, I prefer a short notification of some sort (even just an animated counter on the shopping cart's icon) so that I know my submit action worked, ie. the item was added to cart. I never want to be redirected to the Cart, for example, nor I need a modal window trying to sell me something else as well. So, what is pleasant UX for me might not be a pleasant experience for others and vice versa, of course.
  19. If you have the time, maybe reading some Sitepoint articles you can find some useful info. Just a few examples: https://www.sitepoint.com/premium/books/designing-ux-forms/read/1/jzjar4hq/ https://www.sitepoint.com/premium/books/form-design-patterns/read/1/jz0sdfcg/ https://www.sitepoint.com/premium/books/html5-forms-interactive-elements/read/1/ https://www.sitepoint.com/html-forms-constraint-validation-complete-guide/ I have not read those, but in the past I did read some Sitepoint articles and there were all very good reads.
  20. I think a lot depends on the form's purpose, the client's needs and – of course – on how much time you can spend on a given task. For example, I am working on an "online ordering solution", where the management of multiple addresses is needed, and this is what I already have working for this particular purpose: [image has been removed] So, for this form and for other "record management like" forms in the system, I opted for modal windows, toast messages and inline form error notifications (validation messages). I use Unpoly 2 and Bootstrap 5, btw.
  21. This is the same UX issue I always encounter with "ProFields: Page Table" (aka FieldtypePageTable) as well. So far, I have only solved it for Page Table, but I guess you could do something similar in your case as well. I used JavaScript for the admin to clone the button, like this: /* * Adds a clone of the PageTable field's Add New button to the top of the table */ function clonePageTableAddButton() { $(".InputfieldPageTableButtons").each(function () { $myButtons = $(this); $myTableContainer = $myButtons.closest(".InputfieldPageTableContainer"); //Only add button when Table is not empty (length != 0) and no button has been added already (length < 2) if ($myButtons.closest(".InputfieldPageTableContainer").find(".AdminDataTable").length != 0 && $myTableContainer.find(".InputfieldPageTableButtons").length < 2) { $myButtons.clone().prependTo($myTableContainer); } }); } I also had to solve the issue what crops up when the Page Table is updated via ajax calls, so I had to implement a little bit more what I posted above, but if repeatable fields are not updated via ajax, then probably something no too complex to code should be enough to clone the button after the DOM is ready to be manipulated. Hope this helps.
  22. I agree. However, to make a tutorial series complete, one needs to introduce the basics as well. Perhaps a concise but not too long overview would do the trick (especially if it links to all the official docs and blog posts in order to point out where to learn more about the basics). @3fingers In order to teach as much as possible in the shortest possible time, you might want to provide your learners an installable site-profile which does all the basics already, and you "just" finish it off by implementing the rest (which is everything beyond the basics). I would also pay for such a course, so that I can think outside of my box (and to support your efforts, of course).
×
×
  • Create New...