Jump to content

markus_blue_tomato

Members
  • Posts

    175
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by markus_blue_tomato

  1. 34 minutes ago, ryan said:

     One module I've been working on this week (and last week) enables you to export translations for multi-language fields into JSON or CSV files. These files can be read into other translation systems, edited, and then imported back into ProcessWire.

    🤩

    • Like 1
  2. foreach ($languages as $language) {
     echo $language->title;
    }

    I have a strange problem. I want to use this code to create a language switcher, but for the current selected language the title is alway empty.

    •  /en/ -->  "", "de", "es"
    • /de/ --> "en", "", "es"
    • /es/ --> "en", "de", ""

    It also doesn't work with using $user->language->title

    But it works with "id" and "name" instead of "title"

    Any ideas?

  3. On 2/15/2022 at 11:52 AM, teppo said:

    In recent (4.x) versions of ProCache the docblock for ProCache::___allowCacheForPage suggest that it might be a good place to hook to prevent cache file from being created. I'd probably try hooking there and setting return value to false in case a specific env variable is defined (or not defined).

    Other than that... no obvious solutions here.

    Thanks I will look into this and if it works I will update this post 🙂

    Update: Approach works 🙂

    $this->addHookAfter('ProCache::allowCacheForPage', function (HookEvent $event) {
      $event->return = (!empty(\DROPLET_HOSTNAME) && (\DROPLET_HOSTNAME === "my-droplet-production-01" || \DROPLET_HOSTNAME === "my-droplet-stage-01")) ? true : false;
    });

     

    • Like 1
  4. 9 hours ago, teppo said:

    In recent (4.x) versions of ProCache the docblock for ProCache::___allowCacheForPage suggest that it might be a good place to hook to prevent cache file from being created. I'd probably try hooking there and setting return value to false in case a specific env variable is defined (or not defined).

    Other than that... no obvious solutions here.

    Thanks I will look into this and if it works I will update this post 🙂

    • Like 1
  5. Hi,

    I want to setup ProcessWire in Digital Ocean with a load balanced setup approach. Digital Ocean droplets can have a persistend file system called "block storage volume". The problem is, this block storage volume can't be shared between droplets which leads into issues with uploads and ProCache.

    I solved the uploads problem with the solution that the admin panel is only be used on the first droplets and assets (uploads) are synced with lsync to the other droplets und sessions are saved in redis.

    But I am struggling with this approach with ProCache. Requests to droplets 1 should be cached (and synced to dropled 2 and 3) but requests to droplets 2 and 3 shouldnt be cached since this would break my sync I guess...

    One idea I had is to set env variables on droplet 2 and 3 check the variable in _init.php and set https://processwire.com/api/ref/pro-cache/cache-on/ to false otherwise to true.

    Has anybody ideas to solve this?

  6. I have tried to use following code in _init.php and _ready.php:

    wire()->addHook('/hello-world', function($event) {
        return 'Hello World';
    });

    But got this back when I visit /hello-world:

    Ouch… Error: Exception: Path hooks must be attached during init or ready states (in wire/core/WireHooks.php line 834)

    When I add the hook in init.php I get the 404 Page.

    Can anyone help me here?

    • Like 1
  7. On 9/7/2021 at 5:05 PM, d'Hinnisdaël said:

    @markus_blue_tomato I've noticed that blurhashes aren't regenerated when images are replaced via drag-and-drop in the admin. Have you run into this or is this a known limitation of the module? Best way to reproduce is: clone a page with a populated single-image field, drag a new image into the image field of the cloned page and save. The blurhash still looks like the old image from the page it was cloned from.

    Hm, that sounds like a bug. I would appreciate an PR or Issue Report in Github since I'm very busy the next weeks.

    • Like 1
  8. I have a page with multilanguage support. Processwire always redirects to the default language if no language is in the URL-path.

    E.g. /my-page/ --> /en/my-page/

    But when I have a querystring in the URL, the whole querystring is lost: /my-page/?search=xyz --> /en/my-page/

    How can I solve this? I didn't find anything regarding language URL redirects in the .htaccess

     

  9. On 4/10/2021 at 3:20 PM, StanLindsey said:

    This is great @ryan - Quick question. 

    Digital Oceon doesn't automatically balance between all the read only nodes as RDS does. 

    Is it possible or is it on the roadmap to allow adding multiple nodes in PW and PW distributes between that list of nodes. 

    Could be as simple as an array of dbReaders, with PW randomly selecting from the array for each read request. Or round robin. 

    That would allow it to be much more flexible setup and support self hosting read replicas for example. 

    Otherwise fantastic work this is great. 

    Oh, good to know. Currently I have one Read/Write Node (for the Admin) and one Read-Only Node for the Frontend.

  10. 7 minutes ago, ryan said:

    Next week I also get my 2nd shot of covid vaccine, and I'm told it may slow me down a bit for a day, but will be well worth it.

    Lucky you! In slow vaccinating Austria we have a word for my little feeling called "Impfneid" which means some kind of "vaccination envy/jealousy" ;-D

    • Haha 1
  11. corporate.blue-tomato.com is a new Website about the Corporate behind Blue Tomato. You can find informations about the history and values of Blue Tomato and also all open job positions.

    image.thumb.png.4074a7fb6ae29bed7becd38112f3f049.png

    Used Modules 

    ProCache
    ProcessGraphQL (used with React on the job overview page for searching/filtering the jobs)
    ProFields: Combo
    ProFields: RepeaterMatrix (Used for some kind of a "PageBuilder")
    SeoMaestro
    TemplateEngineSmarty / TemplateEngineFactory

     

     

     

    • Like 10
×
×
  • Create New...