We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19604 ☆ A M B ☆
    • 179 Posts
    Hi,
    I have a TV which stores "related IDs", that are IDs of other resources that may be interesting for the visitor. I do that whith the following getResources call:
    [[getResources? &parents=`-1` &resources=`120,71,45` &sortby=`menuindex` &sortdir=`ASC` &includeTVs=`1` &processTVs=`1` &showUnpublished=`0` &showHidden=`0` &limit=`16` &tpl=`relatedTpl`]]

    Now, when I unpublish a resources, it’s ID is still in the TV "related IDs" of the other resources which are related and still online. But that leeds to the situation, that the relation is shown allthough the resources is unpublished! Say, "71" had been unpublished, it still would apear in the "You might also be interested in this:" box.
    And that is strange, because I explicitly told getResources with "&showUnpublished=`0`" that it shall ignore unpublished resources. For some reason this does not affect resources that are submitted with the "&resources=" parameter. Setting &parents=`` does not help anything.

    So, how can I display a bunch of IDs with getResources and filter out the ones that are not published? This looks like a bug or am I missing something?

    thanks
    Oliver

      MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
      http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
      • 3749
      • 24,544 Posts
      I think &resources will show the listed resources no matter what -- it’s meant to override the other parameters. One alternative would be to delete the resources rather than unpublishing them.

      BTW, you might want to use [[!getResources ... ]], at least while you’re developing, so you won’t be seeing cached results.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 19604 ☆ A M B ☆
        • 179 Posts
        Quote from: BobRay at Jul 06, 2011, 01:25 AM

        I think &resources will show the listed resources no matter what -- it’s meant to override the other parameters. One alternative would be to delete the resources rather than unpublishing them.
        Override the other paramaters? THIS would be a catatrophe! How shall I created a list of related items? This is, what &resources was ment to be used for. Or is there another way?

        Quote from: BobRay at Jul 06, 2011, 01:25 AM

        BTW, you might want to use [[!getResources ... ]], at least while you’re developing, so you won’t be seeing cached results.
        Thanks.
        When is your book available? I am curious. I was thinking of writing on myself.

        best
        Oliver
          MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
          http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
          • 3749
          • 24,544 Posts
          I haven’t used it, but this might be what you want: http://rtfm.modx.com/display/ADDON/tagLister.

          The book is getting very close to publication. It’s essentially done, but still needs an index.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 19604 ☆ A M B ☆
            • 179 Posts
            Quote from: BobRay at Jul 08, 2011, 01:30 AM

            I haven’t used it, but this might be what you want: http://rtfm.modx.com/display/ADDON/tagLister.
            Thanks! I will have a look at it and report here.
            Quote from: BobRay at Jul 08, 2011, 01:30 AM

            The book is getting very close to publication. It’s essentially done, but still needs an index.
            Well, take a good look at A.S. John books, published by Packt. This thing was my start into MODX and because of it I was close to dropping MODX. The book is so badly structured, e.g. no numbers in the headlines, so you don’t no whether it’s a subchapter or a new one you are reading – a killer NO for noobs. And it is full of mistakes in awefully large code listings, which are repeated for no reason: line numbers would have done a better job.
            I wrote some professional books myself and know that it’s a tough job – and you know that know too ;-). Best of luck. I will definitely buy one if I can get it here in germany.

            Oliver
              MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
              http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
              • 3749
              • 24,544 Posts
              I have intentionally not looked at the Packt book, but I hope you’ll find mine to be well-designed and well-organized, though probably not completely error-free. wink
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 19604 ☆ A M B ☆
                • 179 Posts
                Quote from: BobRay at Jul 08, 2011, 02:47 AM

                I have intentionally not looked at the Packt book, but I hope you’ll find mine to be well-designed and well-organized, though probably not completely error-free. wink
                There is not a single pro book without errors! So don’t worry. The audience will love it/you! ;-)
                Oliver
                  MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
                  http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
                  • 36613
                  • 328 Posts
                  I resolve your problem with this sintacs:
                  &where=`{"template":"11","deleted":"0","published":"1"}`