Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Jozsef

  1. I'm having trouble displaying a pagetable field in the same order as it appears on the page edit screen. The child pages are hidden so I use $page->getUnformatted("field") to get the array of pages but a foreach loop outputs them in completely random order. When I try sort("sort") it then appears in the order of the child pages in the page tree so that "sort" refers to the order from the Pages table. I never had trouble with this in earlier versions, this random order appeared in the last two websites I'm developing. Is there a way to access the internal sort of the actual pagetable field as per screenshot?
  2. I see, thanks. I'm looking for something to be used with ProMailer the client already uses to email users based on criteria.
  3. @bernhard, thanks for the suggestion, I was also looking for a low cost (possible free) alternative to SMTP for the client who very occasionally need to send larger campagins (around 8k). MailerSend's free tier does seem to be very good. Thanks for sharing your module too, however since it does not extend WireMail, RockMailerSend can only be used for custom solutions. There's no way to send all transactional emails from Processwire via MailerSend using your solution, correct?
  4. Thanks Bernhard, I'll try it in my next project. I did the exact same thing in most past projects, a headline text field in the format of *Bold Text* in the headline. As wbmnfktr I used the core markdown textformatter but in the template file I had to strip all tags apart from <em>. It was necessary because the core formatter adds paragraph tags around the headline that doesn't play well inside heading tags. Another negative about this approach is that I can't use front end editing. Your readme doesn't say anything about usage, does that mean I can just simply output the text field as $page->headline ? Or even $page->edit("headline")?
  5. Thanks everyone, a lot of learning to do, I'll look into the suggestions. I've never used UIKit but Sortable looks the bill. Updating data would be the real challenge with my skills. @bernhard, such a module would be awesome. ?
  6. Hi everyone. My clients wants me to build a CRM app connected to their existing client site so they have all data in one place. One of their requirements is to have a drag and drop kanban board interface to update their sales status. Does anyone have any recommendation for an existing JS or jQuery library that could be integrated into the PW backend and could update data in real time? Have you done anything like this before? Or does PW have built-in tools for this? I know you can update page parents by drag and drop but can that be reused somewhere else? I'm sorry for the lame question, I'm not very fluent in JS.
  7. I'm in a similar situation where the client asked me to integrate their sales into the existing client facing site since half of the data is already there. Silly question but would it be bad practice to store data as pages? I mean ProcessWire can do all the content types, fields and page references already, would it still be better to store data in the database directly?
  8. Thanks @wbmnfktr I will definitely do. I was also looking into email relay services such as Mailgun or SendGrid but their privacy policies were not acceptable for them. ? Anyway, thanks for everyone for the ideas. We are going off topic though so it will be the WireMailSMTP module for now.
  9. I'm using PrivacyWire with Google Analytics. Looking at their documentation it is possible to load GA4 without cookies. How would I go about updating the GA settings when statistics cookies get approved instead of blocking the analytics script altogether? https://developers.google.com/tag-platform/devguides/consent Is there a JS variable I can check for or I have to parse local storage to find the answer? I understand that I can run a script when consent is changed, I was just wondering if there's anything already exposed.
  10. Thank you @fliwire, that might be another consideration for the client.
  11. Thanks, these are valid points. I'm not a module developer, hence the "simple way" in my question. ? No ideas unfortunately. The site is for cyber security experts, their mindset is to minimise the risk when something happens. Their previous WordPress site was compromised so a breach is not an "if", it's more like a "when" for them as they deal with this all day every day.
  12. I completely agree, I really think that saving the SMTP password as plain text is a big security compromise. Is there a simple way to change this?
  13. Thanks Robin, I didn't know I can use mysqldump directly in a cron job. As for the site, they are debs (prom) organisers for high schools, hence the large number of customers and ticket sales on the site. Otherwise the site is performant and works well within the shared hosting limits. As far as shared hosting goes it's a really good one with guaranteed resources. Thanks, I always wanted to check out your module, I'll give it a try.
  14. Can I reduce the database size or break up the backup somehow? The site's database grew over 100Mb having over 1M rows in total. There are over 150k pages (high number of payments, orders and over 30k users). I use the great CronjobDatabaseBackup module by kixe to trigger hourly updates it uses the core WireDatabaseBackup class. My backup now triggers a PHP error every time, despite max_execution_time is set to 300 on the shared hosting. I think they enforce a maximum of 120 seconds on the database though. Fatal Error: Maximum execution time of 120 seconds exceeded Line 854 of /wire/core/WireDatabaseBackup.php or Fatal Error: Maximum execution time of 120 seconds exceeded Line 961 of /wire/core/WireDatabasePDO.php
  15. @aagd Yes, it's a shared hosting but upgrading is not an option at the moment.
  16. Thanks, that doesn't work unfortunately, the hard limit applies specifically for database processing, according to hosting support. max_execution_time has no effect on it, it was already much higher. I wish it was that simple.
  17. I have a site where the database grew over 100Mb and the hosting implies a 120 seconds hard limit on mysql processing. As a result, all scheduled backups trigger a PHP error: Fatal Error: Maximum execution time of 120 seconds exceeded Line 854 of /wire/core/WireDatabaseBackup.php Any suggestions? The site has over 150k pages (orders and payments on top of content) and over 30k users and I need an hourly backup. Because of the PHP error the Automatic Cleanup is not happening and, backups eventually filling up my hosting storage. Can I reduce the database site? Or speed up the backup process? (Note: the server is quite fast).
  18. Thank you for the detailed answer, it's very educational. I was aware of some of the considerations but I didn't think about cache, for example. I understand that the DeepL service take time, especially with a 5000 word document. ? I did go through the readme multiple times before. Great module and thanks again for the brilliant support here.
  19. Thank you @FireWire, after some wrestling I got it working. My issue was that I assumed that the returned translation is a simple string while it's not. For anyone interested, this is the working function I put together. It returns the translated field value or translates a multi-language field (headline in this case) on demand, if it's not yet translated. You can call it simply <?= translate($page,'headline'); ?>. It's saved and displayed right away. This way it can also be used in a foreach loop where you want to display a field from a different page. Please let me know if something could be improved or simplified, I'm not a PHP guru. Do you think it will have a toll on performance for already translated fields? /* Translate a field if it's not available in current language * * @param object $page * @param string $field * @return string * */ function translate($page,$field) { // If field is empty there's nothing to be translated if (!$page->$field) return; // Get current language setting $lang = wire('user')->language; $page->of(false); // Check if the field is already translated $local_value = $page->$field->getLanguageValue($lang); if (!$local_value) { $fluency = wire('modules')->get('Fluency'); // If not, translate it from default language $translate = $fluency->translate('en', $page->$field, $lang->language_code); // Get the translated string from the response object $translated = $translate->data->translations[0]->text; if ($translated) { // Save the translated value back to the field $page->$field = $translated; $page->save($field); // Set return value $local_value = $translated; } else { // If translation fails and returns empty string // We use the default language $local_value = $page->$field; } } $page->of; return $local_value; } There's still the issue of updated content in the original language but I'm not sure how to deal with that.
  20. I tried to follow examples from earlier in this topic to achieve the following in my template files. The goal would be to save characters for the client and only translate content that is required. Example: - Check if $page->headline is available in the user's language - If not, translate it and save it I could get it to work with my limited PHP knowledge, this is the code I tried: $lang = $user->language; $page->of(false); $local_headline = $page->headline->getLanguageValue($lang); if (!$local_headline) { $fluency = $modules->get('Fluency'); $translate = $fluency->translate('en', $page->headline->getLanguageValue($lang), $lang->name); echo $translate; $page->headline = $translate; $page->save("headline"); } $page->of; The error I'm getting is: Undefined variable: message in /modules/Fluency/engines/DeepL.class.php on line 172
  21. Yes, this is the exact reason why I asked about it. In its current state it's not even as complete as Padloper 1 so the most I could do is playing around with it. And that would not be a proper beta test I'm afraid. It's been years since I last used PayPal for anything so Stripe is a must have on my list, I'm not so much into custom solutions though...
  22. Thanks, Francis. Quick question: Is it an introductory price? Will it increase when you release it to the public?
  23. @Jan Romero, guess what version the site is on: 3.0.191 ? I always use the dev version for new sites and never ran into any issue. There's always a first for everything. ? Thanks a million, I searched the web and the forum up and down but didn't find it. You saved my day.
  24. I've got a strange error I don't know how to debug. Any time I try to add a new page I get the following notifications. It doesn't matter what template I try to use, it's always the same. The page "lithuanian" did not exist yet so the name shouldn't change No page is created at the end. Not with the original or changed name. It just vanishes. Created page /admin/setup/languages/lithuanian-100 using template: language ProcessPageAdd: Warning, the name you selected "lithuanian" was already in use and has been changed to "lithuanian-100". I suspect it's something with the database but not sure where to look. Any idea?
  25. Sounds good, I'll keep an eye out! Thanks again.
  • Create New...