Giter Club home page Giter Club logo

Comments (2)

bezumkin avatar bezumkin commented on September 27, 2024

pdoResources is not getResources.

See http://docs.modx.pro/en/components/pdotools/general-settings for right use of snippet parameters.

from pdotools.

pdincubus avatar pdincubus commented on September 27, 2024

Thanks for your reply. I think I didn't explain the issue very well before. I read through the documentation and it doesn't say that &includeTVList and &tvFilters are mutually exclusive.

In getResources I can specify a list of TVs to fetch for the resources, and filter using a different list of TVs.

In pdoResources can I not do this? The only workaround I can see is to include a list of all TVs I want as part of the tvFilters option.

I did a test page to try and show what I mean.

I set up a page with two template variables: An image and a "section name". I want to find the resources with a certain "section" and show the image from it.

I noticed that getResources uses &parents=-1 to specify specific resources, pdoResources uses &parents=0 to do the same.

##pdoResources

The snippet call:

 [[!pdoResources?
  &parents=`0`
  &resources=`79`
  &processTVs=`1`
  &includeTVList=`mainImage`
  &tvFilters=`sectionClass==guides`
  &tpl=`test`
]]
  • Image: BLANK
  • Section: guides

##getResources

The call:

[[!getResources?
  &parents=`-1`
  &resources=`79`
  &includeTVs=`1`
  &processTVs=`1`
  &includeTVList=`mainImage`
  &tvFilters=`sectionClass==guides`
  &debug=`1`
  &tpl=`test`
 ]]
  • Image: assets/images/ofp.jpg
  • Section: BLANK

In this test, the getResources call returns the correct data, but pdoResources doesn't. The only way I seem to be able to get the output I expect from pdoResources is to do this:

 [[!pdoResources?
  &parents=`0`
  &resources=`79`
  &processTVs=`1`
  &tvFilters=`sectionClass==guides,mainImage==%`
  &tpl=`test`
]]

Which part of my pdoResources call is incorrect? Did I miss something obvious in the documentation?

Many thanks.
:)

from pdotools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.