Jump to content

Recently Updated Topics

Showing topics posted in for the last 7 days.

This stream auto-updates

  1. Today
  2. @biniyam if you configure this module to the restriction you need you should be fine if your form assigns the required role to the users. It sounds like the "Role Specified Branch Parent" might be the best option based on your description - shouldn't need a php script.
  3. Version 2.2.15 is out! This update comes with a small performance upgrade. Now you can choose on which pages you want to embed the JS and CSS files of the FrontendForms module. This means that you can prevent the files from loading on pages that do not contain a form. This also allows these pages to load faster This version includes a new configuration field in the backend where you can select all the pages where you want the files to be embedded. Best regards
  4. Hi @Spinbox, Sorry for delay. Example posted here: Any questions, let me know. Thanks.
  5. Freelancers generaly work a 'morning' 'afternoon' or sometimes 'evening' Those are defined loosly as 9:00-12:30, 13:00-17:00 and 18:00-22:00 The problem i'm trying to solves is that freelancers update their availability say for the coming three month period - and I need their input for each date in that range, per day, per timeslot. My thoughts are that a simple table list with dates and 'morning' 'afternoon' and 'evening' columns would provide them the quickest input for comparison with their other appointments and bookings. (Beeing freelancers!) And I'm very gratefull you're willing to "keep my use case in mind!" 😁 Thank you!
  6. @bernhard thanks for the welcome and the comprehensive list of options! makes sense -- and I was not aware of WireHTTP before. I was able to change the module to use WireHTTP instead of Guzzle quite easily, so now no external dependency is needed. The changes have already been pushed to the github repo.
  7. Yesterday
  8. @ryan, thanks for creating this cool module! A couple of questions: 1. Do the subfields have an ID of some sort separate to the name, such that a subfield can be renamed without losing the existing data stored for the subfield? 2. What happens to stored data if a subfield is removed from the defining file? Does the existing data for the subfield persist in the database, or does the fieldtype detect the removal and do some cleanup to remove the stored data? Also, I think there's a typo in the blog post. // multi-selection foreach($page->custom_field->countries as $value) { $label = $page->field->label('countries', $value); echo "<li>$value: $label</li>"; // i.e. "USA: United States" } ...should be... // multi-selection foreach($page->custom_field->countries as $value) { $label = $page->custom_field->label('countries', $value); echo "<li>$value: $label</li>"; // i.e. "USA: United States" }
  9. I understand the idea, this is actually a problem that application might break if this setting change. But instead of adding methods I would remove the setting, no more choice between different return types, only Page|null (and PageArray for multiple). Simplicity... 😁 Obviously it would break actual sites deployed with PW, so maybe for a ProcessWire 4.0... ^^
  10. Oh excellent, thanks! I’ve been asking myself this, but been too lazy to actually figure it out instead of just changing the table manually for project-specific modules 😄
  11. AltTextGpt for ProcessWire This ProcessWire module, AltTextGPT, is an interface for generating alt text for all of the images in your website, using the ChatGPT Open AI API. Using the API requires an account with the Open AI API and costs money, although its pay-what-you-use and the charges are minimal. For example, alt text was generated for 200 images, using 94 cents of Open AI Credits. You can create an account with Open AI, from this link, and then once you have an API key, you can enter it below, or configure it as a permanent setting for this module via Modules->Configure->AltTextGpt. After configuring the API key as described above, you can then use the form below to generate alt text for images in the site. The module will attempt to generate alt txt for every image that currently has no alt text, one at a time. Generating alt text takes a few seconds for each image, so this is not an instantaneous process. For this reason, if you have many images, we suggest generating alt text for the images in batches. You can also set a batch size below, generating alt text for 10 or 20 images at a time, and then repeating the process, until you have generated alt text for all of the images in the site. After each run, the table above should show that there are fewer images without alt text in the site, until eventually the table indicates that there are 0 images in the site without alt text. Note, for alt text to show up for images uploaded in the body of a CKEditor field, this configuration must be set for that field as described in this comment. How to install this module Copy all of the module files to /site/modules/AltTextGpt/. In your admin, go to Modules > Refresh. Click “Install” for the “AltTextGpt” module (on the “Site” tab). The code for the module is tested and working and is currently here: https://github.com/mhfowler/AltTextGpt
  12. I made a ProcessWire module that automates generating alt text with the Open AI API. More info here: The repo is here: https://github.com/mhfowler/AltTextGpt
  13. I did something similar using image tags. I placed all the photos in an image gallery and assigned the 'cover' tag to the desired photo to be used as the cover. Then: $image = $page->images->find("tags=mytag")->first(); My client actually loved this approach because we created new tags, and they can now assign them according to the position where the photo will be used
  14. I'm working on RockCalendar which will be released soon if everything goes smoothly 😎 I think it should be stable enough next month. If you want to get notified you can subscribe to the Rock Monthly Newsletter. The module uses https://fullcalendar.io/ for the calendar interface and when clicking an event it will open the page editor in a pw modal: Opening the modal was a bit of a challenge, because PW unfortunately does not offer a good JS API to open modals. It only offers markup-based options to control the behaviour of the modal - at least as far as I could find out. This is a problem, because all events in the calendar get loaded by fullcalendar and I only have the eventClick() callback where I need to fire my action. My solution is to create a fake element in the dom and trigger a click on that element: calendar.on("eventClick", (info) => { // create a fake link element in body let link = document.createElement("a"); let $link = $(link); $link.attr( "href", ProcessWire.config.urls.admin + "page/edit/?id=" + info.event.id ); $link.addClass("pw-modal"); $link.attr("data-autoclose", ""); $link.attr("data-buttons", "button.ui-button[type=submit]"); $link.on("click", pwModalOpenEvent); $(document).on("pw-modal-closed", this.refresh.bind(this)); $link.click(); $link.remove(); }); Maybe that helps anyone else looking for a solution to a similar problem. If anybody knows a better way how to do it, please let me know! PS: If you have input (feature requests) for the development of RockCalendar please let me know: https://processwire.com/talk/topic/30355-request-for-input-what-features-should-a-pw-calendar-module-have/
  15. Done: restructure install.php to do away with warnings by poljpocket · Pull Request #300 · processwire/processwire (github.com)
  16. Last week
  17. LogsJsonViewer doesn't do any truncating, and doesn't get involved in the saving of log data at all - it just formats what is already in the log. Your problem might be due to $maxLineLength in FileLog. There's a FileLog::setMaxLineLength() method, but I'm not sure how you could practically use this unless you write to your log file using FileLog::save() instead of the more convenient WireLog::save(). Instead you probably just have to try and avoid going over $maxLineLength if you are saving JSON, perhaps by doing your own truncation on individual values if they are long, before you save the data.
  18. Wasn't there a module that surfaced this information in the admin? Anyone remember what it was called? I can't find it. Edit: TracyDebugger can do it.
  19. I bet $contact is coming from a page reference field that is configured to return false when empty. So if $contact is optional, the code should verify its value before to use it and call renderContactSmall(). For the empty selector, it's necessary to investigate the code that generates it, and log value of variables it's using.
  20. When I need to load a fair amount of data I do custom MySQL queries. findRaw() is very fast too but I don't like to parse its results. Just be careful to sanitize data where needed (all texts at least). The downside is that it takes much more development time. But I become better in MySQL stuff. 😁
  21. I've done a video about DDEV, but it doesn't go through setting up ddev. Just follow the instructions on the ddev website. For this you need to tell tracy debugger where the files live on your local file system. This is because PW + Tracy run inside the container and inside the container your files live in /var/www/html. So if you click on a debugging link in tracy then your OS tries to find the file /var/www/html/foo.php and obviously can't find it. // tracy config for ddev development $config->tracy = [ 'outputMode' => 'development', 'guestForceDevelopmentLocal' => true, 'forceIsLocal' => true, 'localRootPath' => '/path/to/your/project/', 'numLogEntries' => 100, // for RockMigrations 'editor' => 'cursor://file/%file:%line', ]; The important part for you is the "localRootPath" setting.
  22. Alright, I just looked at what I did to address this and it looks like I just renamed the two files to ProcessLogin.js.bk and ProcessLogin.min.js.bk This is, of course, not an elegant solution but it did solve the problem very quickly. I do recall now that I need to go into the server and see how the system time is setup relative to any php/pw settings that may be causing this problem systemically.
  23. You're right, but how is it possible to move sideways (x-axis) without going slightly up or down (y-axis)? I don't really understand why y-axis movements should trigger any change at all.
  24. @poljpocket You are absolutely correct. After configuring the homepage URLs like you suggested. Language translation is working fine. Thanks for the help. Thank you all.
  25. Update to my last post. The fix sadly isn't easy enough. At least for the whole function "collapse" it is not. The line itself is fixed but, this code here does unexpected stuff when $r = ''. https://github.com/processwire/processwire/blob/3cc76cc886a49313b4bfb9a1a904bd88d11b7cb7/wire/core/WireTextTools.php#L454-L456 foreach($this->getPunctuationChars() as $c) { if(strpos($str, "$c$r")) $str = str_replace("$c$r", "$c ", $str); } Here, the strpos check actually will match any punctuation character no matter the position because the real issue is that we are losing any reference to the replacement positions when the replacement is nothing.
  26. Oh boy! Of all people I know to provide details and I didn't! Apologies! No, as it turns out there is some sort of error in an array: I have the following code in _main.php (simplified for ease of explanation): <div id="content"> <h4 class='text-center'> <br><br><br><br> We're making a few backend updates to the site, please check back shortly. </h4> <br><br><br><br> </div> If all goes well with RockFrontEnd parsing a template, the <div id="content"> is overridden with the latte template output. If however, there is an error in RockFrontEnd parsing of a .latte template, it outputs: "We're making a few backend updates to the site, please check back shortly." Which is great for the end user but not for me while developing because I didn't know what the actual error was. Enter TracyDebugging tool: Through my own fault: I didn't have debug enabled for certain templates. Hence it wasn't visible on pages I was trying to debug. I seriously need to polish up on my debugging skills. I hope that makes sense. Greg
  1. Load more activity
×
×
  • Create New...