Quote from: jgrant at Dec 22, 2012, 10:05 AMCheck your email; I sent that to you last night, just after 11pm central time. Let me know if you didn't get it and I'll resend.
I created chunks for my else/then code, but I'm now getting some bad data, so I'm wondering if by moving that code into chunks, it is altering the results.
It shouldn't be, unless there's something else going on. Here's a good post on the technique and how it works: https://www.markhamstra.com/modx-blog/2011/11/nested-caching-in-modx-revolution/.
Please resend that snippet if you could, I don't see it, nor in my spam....Thanks!
Yeah, this caching is so confusing. Basically, on my two branches, it was returning the first result of data it found, and used that data for each result. Anyhow. Here is what I have now. Still not loading on initial load (time's out), but I think this code is def cleaner:
[[!StoreLocator?
&searchZoom=`10`
&zoom=`4`
&width=`640`
&height=`480`
¢erLongitude=`-95.712891`
¢erLatitude=`37.09024`
&formTpl=`store-form`
&noResultsTpl=`no-store-results`
&limit=`0`
&storeRowTpl=`store-row`
&storeInfoWindowTpl=`store-info-window`
]]
store-info-window is:
<div class="storelocator-marker" style="width:450px;height:auto;">
[[+parent:eq=`2888`:then=`[[getResources? &tpl=`window-1` &parents=`-1` &resources=`[[+id]]` &limit=`1` &includeTVs=`1` &processTVs=`1` ]]`:else=`[[getResources? &tpl=`window-2` &parents=`-1` &resources=`[[+id]]` &limit=`1` &includeTVs=`1` &processTVs=`1` ]]`]]
</div>
store-row looks like:
<div class="store-result">
[[+parent:eq=`2888`:then=`[[getResources? &tpl=`row-1` &parents=`-1` &resources=`[[+id]]` &limit=`1` &includeTVs=`1` &processTVs=`1` ]]`:else=`[[getResources? &tpl=`row-2` &parents=`-1` &resources=`[[+id]]` &limit=`1` &includeTVs=`1` &processTVs=`1` ]]`]]
</div>
and then in my getResources templates, I am getting all the TVs values. It all works fine, except for the initial load still with no value in the query. If I set a limit in the Store Locator call, I can "trick" it into loading, then once I have the form up, I can remove the limit and do a search, it runs fast then and I can test my results. But then if I hit "Clear", we time out.
Anthony