We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41648
    • 3 Posts
    Hello
    I have migxDB on my site.
    I use CookieList snippet to save fild 'id' in cookies, and want to return
    at another part of page the list of matching filds.I try to used migxLoopCollection as you can see below,
    but it not work correctly. It return all items from the table.

    [[migxLoopCollection?
    &packageName=`catalog`
    &classname=`CatalogContent`
    &where=`{"ID:IN":[ [[!getCookieList?]] ]}`
    &tpl=`InquiryItemTpl`
    ]]

    I have tryed to check CookieList and put [[!getCookieList?]] on the same page and it return ids as: 2,3,5(for example)
    If I call migxLoopCollection with &where=`{"ID:IN":[2,3,4]}` , it is working properly.
    Would you kindly advice me any solution?
      • 4172
      • 5,888 Posts
      since the CookieList will change from request to request, calling getCookieList uncached is correct,
      but then, you need to call getImageList also uncached for two reasons.
      1. MODX does first parse the cached migxLoopCollection, before the uncached getCookieList was parsed.
      2. migxLoopCollection would allways return the cached result of the first request after the cache was cleared.

      So try:

      [[!migxLoopCollection?
      &packageName=`catalog`
      &classname=`CatalogContent`
      &where=`{"ID:IN":[ [[!getCookieList?]] ]}`
      &tpl=`InquiryItemTpl`
      ]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 41648
        • 3 Posts
        Thank you for your help and explanation, now site is working correctly.