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

    I have a getResources call that is successfully returning results - all working as expected and good. But it's really, really slow, I assume this is because it's querying every TV in all the documents specified, but I only need to query the contents of three TVs (pagetitle, longtitle, and a custom image TV called 'projectThumbnail' which seems to be the one that's causing the delay). Is there a way to limit getResources to querying only those 3 TVs?

    This is my getResources call...

    [[!getResources? &limit=`10` &parents=`36,47` &includeTVs=`1` &processTVs=`1` &tvFilters=`tagMarket==[[*tagMarket]]` &resources=`-[[*id]]` &tvPrefix=`` &tpl=`relatedProjects` &sortbyTV=`pagetitle` &sortdir=`ASC` ]]
      • 22303 MODX Staff
      • 10,725 Posts
      First pagetitle and longtitle are not TemplateVars, they are Resource Fields, and as such, they cannot be used in the sortbyTV filter. You'll have to use sortby for that field. As for limiting the TemplateVars that are included/processed by getResources, this is not currently an option, but would make a great feature request if you wouldn't mind.
        • 2396
        • 101 Posts
        OK, sorry for my confusion, and I'll make the request for a feature. I guess I'll need to rethink how the resources are aggregated.
          • 2396
          • 101 Posts
          WOW! Thanks opengeek - your speedy response to the feature request was awesome, thank you so much. The update is exactly what was needed to fix the problem. My page load times have gone from a ridiculous 18 seconds or so down to around 3 seconds. Many, many thanks!