We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36516
    • 179 Posts
    Hello everybody.

    I've just installed and used - to GREAT success, initially - MIGX as a means to construct more complex 'objects' using multiple TVs.

    Everything was going swimmingly until I decided I needed to get the width and height from an image TV (yeah, that old chestnut). I ended up writing my own little snippet to make a quick getimagesize() call, as per several other threads, but instead of calling the snippet twice each time (once for width, once for height) and outputting directly from the snippet, I decided to enhance it through the use of placeholders.

    So, I have data for two sets of MIGX TVs (to construct an image link with a note below). I'm calling MIGX *uncached* from a cachable page (might need to rethink that, for a start. I have difficulty imagining a scenario in which I WOULD allow a page to be cached, given that I have a dynamic menu on every page). I've provided it a chunk to use for the Tpl, and to kick that off I added an *uncached* call to my new snippet which takes the [[+image]] placeholder from each MIGX object and produces a couple of placeholders: [[+width]] and [[+height]].

    Everthing seemed to work perfectly, got all the data out on the screen, including images, but it became immediately obvious that both the images shared the width and height of the last one. Seems I've misunderstood how all this works because I was clearly hoping that each time the chunk (Tpl) would get used by MIGX, my snippet would be called and updated width and height values would be applied to the CURRENT object, and NOT all the previous ones.

    So I tried using the placeholders uncached, as in [[!+width]] - no joy. More confusingly, I decided it might pay to call the MIGZ image placeholder uncached too, [[!+image]] and that just broke it totally.

    I thought I had my head wrapped around the caching system, which I seem mostly to avoid at all costs, but I just can't get my snippet's placeholders to stay unique. Can anyone tell me where I might be going wrong?

    Cheers very much.