We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    This is an auto-generated topic for getResources 1.1.0-pl by opengeek.

    Brief Description:


    getResources 1.1.0-pl (July 30, 2010)

    • - Added &toPlaceholder property for assigning results to a placeholder
    • - Added &resources property for including/excluding specific resources
    • - Added &showDeleted property
    • - Allow multiple contexts to be passed into &context
    • - Added &showUnpublish property
    • - Added getresources.core_path reference for easier development
    • - [[#ADDON-135]] Make output separator configurable via outputSeparator property
    • - Add where property to allow ad hoc criteria in JSON format
      • 11031
      • 11 Posts
      Hello

      I use MODx Revolution 2.0.0 and getResources 1.1.0-pl
      There is a folder called "banners" of its id = 18, there are pictures of banners.
      There is a snippet that displays all of these banners
      [tt][[getResources? &parents=`18` &includeContent=`1` &tpl=`BANNER-tpl`]][/tt]

      But the problem is displayed on the page defined banner.
      Created for this TV (listbox multi-select), entitled "Banner" which selects a list of all banners:
      [tt]@SELECT GROUP_CONCAT(CONCAT(pagetitle, ’==’, id) SEPARATOR ’||’) FROM modx_site_content WHERE parent = 18[/tt]
      It turns out the construction of the form: banner1==id||banner2==id

      And then in the settings of each page, I choose which banner to show.
      But how to remake getResources that he understood this filter, I do not understand, tell me please.

      In my understanding must be that something like this:
      [tt][[getResources? &parents=`18` &includeContent=`1` &tvFilters=`Banner` &tpl=`BANNER-tpl`]][/tt]
      Tried and there are options:
      [tt][[getResources? &parents=`18` &includeContent=`1` &tvFilters=`Banner==%` &tpl=`BANNER-tpl`]][/tt]
      [tt][[getResources? &parents=`18` &includeContent=`1` &tvFilters=`Banner==%` &tpl=`BANNER-tpl` &includeTVs=`1`]][/tt]
      [tt][[getResources? &parents=`18` &includeContent=`1` &tvFilters=`Banner==%` &tpl=`BANNER-tpl` &includeTVs=`1` &processTVs=`1`]][/tt]
        • 22303 MODX Staff
        • 10,725 Posts
        What is in your BANNER-tpl? The last one with &processTVs=`1` should work for you.
          • 17883
          • 1,039 Posts
          Hi Jason,

          is it a expected behaviour that TVs in the content field are not being parsed?

          [[!getResources? &parents=`25` &tpl=`gR_tpl` &sortby=`menuindex` &includeContent=`1` &tvPrefix=`` &includeTVs=`1` &processTV=`1`]]


          Chunk gR_tpl:

          <h3>[[+pagetitle]]</h3>
          <div>
          [[+content]]
          </div>


          Sample Content:
          <p>I am the content</p>
          <p>I am the TV: [[*myTV]]</p>


          With "myTV"as a simple text TV. Result is that the TV in the content field doesn`t appear. Tried it with chunks and a simple snippet, all of which get rendered.
            • 17883
            • 1,039 Posts
            Next question:

            According to the documentation a filter like

            &tvFilters=`kategorie==kategorie2||kategorie==kategorie3`


            should only display resources with the TV "kategorie" set to kategorie2 OR kategorie3. But gR shows ALL resources. If I reduce it to

            &tvFilters=`kategorie==kategorie2`


            gR displays only resources with the TV set to kategorie2, as expected.
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: MadeMyDay at Aug 03, 2010, 02:20 PM

              is it a expected behaviour that TVs in the content field are not being parsed?
              If it appears in the content as a TV tag, then it would be parsed as if it were on the Resource with the getResources call rather than on the original Resource.

              Also BTW, &processTVs=`1` vs. &processTV=`1`
                • 22303 MODX Staff
                • 10,725 Posts
                Quote from: MadeMyDay at Aug 04, 2010, 09:26 AM

                According to the documentation a filter like

                &tvFilters=`kategorie==kategorie2||kategorie==kategorie3`


                should only display resources with the TV "kategorie" set to kategorie2 OR kategorie3. But gR shows ALL resources. If I reduce it to

                &tvFilters=`kategorie==kategorie2`


                gR displays only resources with the TV set to kategorie2, as expected.
                Perhaps file a bug at http://github.com/opengeek/getResources/issues; it should work as an OR like that AFAIK.
                  • 25373
                  • 13 Posts
                  Hi,

                  for me, the &resources parameter does not WAD.

                  documentstructure is
                  id25 (resource as container)
                  -id26 (resource)
                  -id27 (resource)

                  snippet call:
                  [[!getResources? &parents=`25` &resources=`27` &tpl=`rbox` &includeContent=`1`]]


                  but what is being output is resource id26 and id27...

                  I then checked the snippet code and found around line 148:

                  $criteria->orCondition(array('modResource.id:IN' => $include),null,10);


                  which i changed to

                  $criteria->andCondition(array('modResource.id:IN' => $include),null,10);


                  (short: changed "orCondition" to "andCondition")

                  now it works as I would intend it to WAD.
                  But I would like to avoid hacking snippets from package management, since they may get overwritten with future updates.

                  Is this a bug, or is it me doing something not in the correct way?

                  Thanks
                  Alex

                  PS: I dont have a github account, otherwise i would have filed a bugreport there. (if i could be sure it is a bug anyway, hehe)
                    • 22303 MODX Staff
                    • 10,725 Posts
                    I can’t tell what you intended by turning this into an AND condition. It was intended to work as an OR condition though.
                      • 25373
                      • 13 Posts
                      my intention is, when using getResources &resource=`27` to output ONLY resource 27, and not 26 AND 27.
                      (given the example in my last posting)

                      do i use the parameter wrong?

                      rgds
                      Alex