Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sodesign's Achievements

Full Member

Full Member (4/6)



  1. Hi all, I was reading Ryan's post about a simple approach for caching chunks of markup on dynamic pages. Is there any common wisdom on when this approach is more suitable than the $cache API? The pieces of markup I'm working with are around 300-600kb and I'm trying to identify the option with the best performance. Thanks!
  2. Amazing, I'll give this approach a go and let you know how I get on. Thanks you for taking the time to write this up, I really appreciate it 🙂
  3. That makes sense, finding the connection between production 'media manager pages' and the staging usual pages media manager fields is where I was getting stuck trying to use a selector but your suggestion of looping through and creating the two arrays to compare is a great idea. The only question I still have is with point 8: How do I add a MM page to the MM field using the API if the field is currently empty? I'll be sure to check out ProcessDatabaseBackups! Can it handle individual parts of a site?
  4. Thanks for getting back to me. Yes, I did mean a FieldtypeMediaManager field on a usual PW page. The sites aren’t on the same server currently.
  5. I wonder if anyone can help. I'm writing an import script to add a few hundred pages to a site, and each page has a media-manager-image field. (It's for a staging site where I'm merging some recent content from a production site to keep it up-to-date.) I successfully imported the pages using the native Processwire Import/Export, but the media manager fields were empty. I think this is because the page IDs are different on the production site and the staging site. I have also successfully imported all of the media manager pages and assets to the staging site. Is there a way I can populate the media-manager-image fields with the API? Thanks in advance, I've been pulling my hair out trying to achieve this! 😅 // I tried this approach, but it's not right $existing_image_path = extract_img_path($img); // custom function to parse CSV, eg '/site/assets/files/86258/an-image-name.jpg' $exists = wire('files')->exists($existing_image_path); if ($exists) { // This doesn't work because it's not an image field $p->blog_images->add($existing_image_path); } $p->save(); // I then tried several ways like this, because the media is all on the staging site, but I couldn't find a way to query the media manager // pages successfully $filename = extract_img_filename($img); // custom function to parse CSV, eg 'an-image-name.jpg' $filename_query = "media_manager_image.filename=$filename"; $m = wire('pages')->find("template=media-manager-image,$filename_query"); if ($m->id > 0) { // This doesn't work because it's not an image field $p->blog_images = $m; } $p->save();
  6. Perhaps you could increase the php memory limit if it's set low. https://documentation.mamp.info/en/MAMP-PRO-Mac/FAQ/PHP/Increase-the-PHP-memory-limit/ Otherwise, can you describe more specifically what you're trying to achieve when development feels slow?
  7. Hi everyone, I'm working a on a big site redesign at the moment which requires a separate staging site. The client is regularly publishing changes on the production site which we occasionally need to merge across to the staging site, along with things like contact form entries. ProcessPagesExportImport generally does a great job here, but we're finding some instances where images aren't merged across. Specifically built-in image fields, images within CKEditor fields, images within repeaters, and media fields from the MediaManager module. Sometimes they migrate successfully, sometimes they don't. I'm not seeing any error messages or exceptions in the logs. Are there any gotchas I need to be aware of? I wondered if it might be to do with the fact pages have different IDs in production/staging, or that a page ID might already be occupied on staging by a different page. Thanks!
  8. I'm writing a custom translation exported for a client and I'm having trouble outputting static translations in languages other than the default. Here's what I'm trying to do, but it's just outputting English both times. I must be missing something, but can't see anything in the docs or forum about how to acheive this. <?php function echoSnippet($string, $lang) { // Echo the string in english wire('user')->setLanguage(wire('languages')->get('name=en')); echo __($string); // Echo the string in german wire('user')->setLanguage($lang); echo __($string); } $lang = $languages->get("name=de"); echoSnippet("Page not found", $lang); Does anyone have any pointers? Thanks!
  9. Ohh, this is perfect - exactly what I was looking for. Thanks for pointing this out.
  10. Yes of course. We're working on a big redesign of an existing site with around 40 templates and almost 100 fields. We're updating one section at a time, and currently we're selecting the templates, partials etc based on the page and the user's role by passing a different path into wireRenderFile. We haven't found a way to dynamically change the field templates used.
  11. Hi everyone, I'm using a Matrix Repeater field called 'items', and looping through like this: foreach($page->items as $item) { echo $item->render(); } This automatically uses the fields/items/[item-type].php file to render the field. Is there a way to programatically change either the filename or the directory this uses? Thanks! Tom
  12. Bizarrely disabling Tracy Debugger was what stopped the issue for us in the end. I probably just need to update the module. Thanks for your help ?
  13. Hi Chris, We're seeing the same thing after upgrading one of our sites - did you find out how to fix it? Thanks, Tom
  14. Thanks for your reply @flydev ?? I have looked through our nginx config, and I can see the lines fastcgi_ignore_headers Cache-Control Set-Cookie Expires; fastcgi_pass_header Set-Cookie; fastcgi_pass_header Cookie; fastcgi_cache OPS-FASTCGI; fastcgi_cache_valid 240m; fastcgi_cache_bypass $no_cache; fastcgi_no_cache $no_cache; The $no_cache param is set based on the request uri, and I did notice one 'private' url had been missed from the exclusions at the time of the issue. This really isn't my area of expertise, and we set up the config some time ago, inspired by Trellis (in wordpress land). I noticed someone questioned them about the inclusion of the fastcgi_pass_header Set-Cookie property (https://discourse.roots.io/t/nginx-caching-configuration-in-trellis/7056) Would removing fastcgi_pass_header Set-Cookie be a good idea? Is there any reason this would need to be passed?
  • Create New...