We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27716
    • 126 Posts
    Hi Guys,

    I have some questions about getResources / getPage.

    Im using these do display a set of documents. Over time the documents have got an increasing number of template variables. Does this mean more template variables, the less efficient getRecources will become? As i need to include the TVs in the get resources call.

    Is there any way to only pull the required TVs in the getResources call?

    Any guidance appreciated.

    Stuart


    This question has been answered by smcilreavy. See the first response.

      • 33968
      • 863 Posts
      Hi Stuart, I think you can only 'include all' or 'include none'.

      However depending on what you need to do, a fairly simple custom snippet would allow you to specify the exact TVs you need, which will be much more efficient as your site grows. How's your php coming along? smiley
        • 27716
        • 126 Posts
        Hi Lucas,

        Slow progress on the PHP smiley But have a few things to do soon that my give another chance to practice.

        I remember a while back reading that they were thinking of adding this functionality to getResources.

        Im about to add more functionality that will add a whole new set of TVs to the main video documents and they are starting to look pretty bloated. Hoping to make the site faster.....not bog it down.

        Is the snippet method a great deviation from getRescources / getPage or does it still primarily rely on getResources.

        (P.S Modx) The forum isn't sending reply notifications since the forum upgrade? Not sure Why. Checked my spam bin also....
          • 33968
          • 863 Posts
          I'm not getting notifications either - have filed a bug report so I guess the guys are aware of it.

          Which fields do you need to be retrieved by the snippet? If you post your 'rowTpl' chunk that should give us a good idea...
            • 22303 MODX Staff
            • 10,725 Posts
            See https://github.com/opengeek/getResources/issues/49 for a solution to this that will be included in a 1.4.0 release due shortly.
              • 27716
              • 126 Posts
              Hi Guys,

              Got that notification so it looks like it is fixed.

              Lucas, the template is using 3ish TVs, View count, Duration and the image. That's out of 18 total smiley And probably about to add 5 ish more....So there is a pretty big inefficiency....

              It would be nice to achieve this with getRescources so may hold for a bit and see when the update comes out. Hoping it will also cut back on page load time.

              Stuart

                • 27716
                • 126 Posts
                Hi Guys,

                I just installed getRescources 1.4

                After adding the includeTVList im not entirely certain its working. When I added the incorrect TVs the correct ones were stil coming up in the call. I have cleared cache.

                If it limits TVs being returned, surely If I call it and dont include the required TVs the resulting page should have missing elements?

                Let me know if Im missing something. The call is below.

                Stuart

                [[!getResources? &limit=`5` &tvFilters=`recommended==1` &parents=`2` &tpl=`recommendedTemplate` &includeTVs=`1` &includeTVList`27,9,8` &processTVs=`0` &tvPrefix=``]]
                  • 23491 ☆ A M B ☆
                  • 1,056 Posts
                  @smcilreavy,

                  I think you need to update two things:

                  1. includeTVList is missing the "equals" sign (e.g. &includeTVList=``)
                  2. I believe includeTVList expects TVs by name, not ID:


                  processTVList - (opt) Limits the TemplateVars that are processed if included to those specified by name in a comma-delimited list [default=]
                    Mike Reid - www.pixelchutes.com
                    MODx Ambassador / Contributor
                    [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                    ________________________________
                    Where every pixel matters.
                    • 27716
                    • 126 Posts
                    Hi pixelchutes,

                    I was under the impression that &processTVs=`0 would mean that no TVs are being processed, and therefore processTVList=`` Would not be required?

                    Is the not correct?

                    Stuart
                      • 22303 MODX Staff
                      • 10,725 Posts
                      Including TV's and processing them are completely separate processes. One simply "includes" the raw value of the TV for the Resource (or the default). The other processes the raw value according to the type of TV, output properties, input properties, etc., to get the final value of the TV for the Resource.

                      The *TVLIst properties limit what TV's are included and processed respectively, though keep in mind if it's not included, it can't be processed. IOW you cannot use a TV name in processTVList if it is not in includeTVList.