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

    Can you explain the use of GetResources in plain English?

    Can you make it clear/easy to understand?

    Break it down to the simple basics.
    Dumb it down for me, will you?

    Step 1. I downloaded/installed Modx Revolution, and it’s working!

    Step 2. Created 3 templates plus 3 resources, and all of them are working!

    Step 3. Downloaded a snippet called "GetResources".

    Step 4: However, it’s sitting in my "/snippets/" folder, not doing anything. I’d like to use it for outputting a list of my "resources" on one of my pages/resources. Is it too much to ask for? Or do I need to be more specific?


    Now...
    a) Now, what the heck should I do with the "GetResources" file?

    MY IDEA 1: Leave *GetResources* file sitting in the ***snippets*** folder (or move it to somewhere else? )??????
    In the documentation there are no instructions about this!

    MY IDEA 2: Call it on one of my ***templates*** (or somewhere else)??????
    In the documentation there are no instructions about this!

    MY IDEA 3: Use the code ***[[getResources]]*** -- (or another variation of this code)?????
    There are an unlimited number of possibilities, which only add to the confusion and lack of clear directions.

    b) Don’t get me started on it. However, the so called GetResources "documentation" is hard to find. Then when
    you do find it, you might find it’s ZERO help (at http://rtfm.modx.com/display/ADDON/getResources). It’s so
    little or no help that it’s incredible. It’s almost like as if the author was thinking, "OK, guys, I’m going
    to write you a "document" but I will make it as brief/cryptic as possible, so that no one will understand it,
    unless the reader/user/end user already knows more about it than I, myself, the author."

    c) Ditto for the "examples". The examples are ZERO help (at http://rtfm.modx.com/display/ADDON/getResources).
    For example, quoting the document....

    Example (from the documentation)
    ***********************************************************************************
    Output a list of child Resources of the current Resource, using the ’myRowTpl’ chunk:
    1 [[!getResources? &parents=`[[*id]]` &tpl=`myRowTpl`]]"
    ************************************************************************************

    Okay, let’s try to follow this geeky/cryptic/hard-to-decypher instruction.
    I tell you... no use so far.
    My copy of GetResources is still in my snippets folder.
    I’ve added the following code to "Template123", i.e. one of my templates:

    Code
    *****************************************************
    [[!getResources? &parents=`[[*id]]` &tpl=`myRowTpl`]]
    *********************************************************

    I refresh the Resource123 page (i.e. the page that uses Template123).
    What’s happened?
    What’s the outcome of this exercise?
    Do I see anything?
    Do you see anything?

    I see nothing!
    Absolutely nothing!

    Dumb it down for me, please!
    Tell me about GetResources in plain English!
    Explain it in baby talk!

    Please!

      Best regards,
      Mike

      MODx Revolution 2.0.7 and 2.0.8 powered by PHP 5.3.5 / Apache 2.2.17 / MySQL 5.0.7 on Shared hosting
      MS Vista and FF 3.6.15 / Many dot com web sites.
      Timezone: America/New_York
      • 3749
      • 24,544 Posts
      I’ll give it a shot. You actually got pretty close, but it’s hard to make any progress when you get no output at all. BTW, the fact that you got no output is actually a sign that you did most things right, believe it or not. If you get things wrong, GR will actually dump the massive and dizzying array containing all resource fields to the screen. wink

      The point of getResources is to show the content of a collection of resources (e.g., documents). It will show the children of the resource(s) named in the &parents parameter.

      Your snippet call tells tells GR to show content from the children of the resource(s) named in the &parents paramter using the named tpl to determine what is shown.

      The key is that the resource you name in the &parent parameter have to have children (resources under it in the Resource tree at the left). If you set &parents=`0`, you should get all the resources on the site.
      Setting is as `[[*id]]` puts the ID of the current resource there, so you’d get children of the resource you put the getResources tag in.

      You can certainly put your getResources tag in a template, but usually it goes in the Resource Content field of a particular document you want to use to show the aggregated content of a collection of other documents.

      You don’t have to move the snippet or its code anywhere. MODx will find it from the name in the tag.

      Here’s where you most likely went wrong (assuming that there are some children to show):

      - By default, the children have to be published and not hidden from menus (per the checkboxes you see when you edit the resources themselves).

      - The tpl chunk also has to have some placeholders for the resource fields (pagetitle, longtitle, etc.) and those fields have to be filled in for each document when you edit the document on the Create/Edit resource panel.
        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
        • 23299
        • 1,161 Posts
        This thread really highlights the poor manner in which much of MODx is presented.

        Don’t get me wrong, I love MODx, but the presentation, documentation, and explanation often reduces users to the level of frustration this OP is describing...
          • 20725
          • 32 Posts
          Hi Bob,

          I’m still not getting any output,
          but I believe, with YOUR HELP, we are making progress.
          Because I’ve learned that:

          1. I can leave GetResources where it landed right after its installation (because Modx will find it).

          2. I could/should put the code (see below) in the resource content field.

          3. I should put zeroes "0" in the parent fields of each of my resources/pages.

          So far there’s no output yet. Right now
          I’m experiementing with:

          a) [[!getResources? &parents=`0`]]

          and/or

          b) [[!getResources? &parents=`[[*id]]`]]
            Best regards,
            Mike

            MODx Revolution 2.0.7 and 2.0.8 powered by PHP 5.3.5 / Apache 2.2.17 / MySQL 5.0.7 on Shared hosting
            MS Vista and FF 3.6.15 / Many dot com web sites.
            Timezone: America/New_York
            • 3749
            • 24,544 Posts
            I’m not disagreeing with you, but I’ve been in that state with almost every new piece of software I’ve used and have been much more frustrated by iTunes, TurboTax, Quicken, Excel, MS Word, Gimp, PhotoShop, and a number of other programs than I have ever been with MODx, and many of them had highly paid employees whose only job was to make things easy for me -- a luxury we don’t have here. smiley
              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
              • 20725
              • 32 Posts
              Quote from: Photowebmax at Feb 01, 2011, 10:20 PM

              This thread really highlights the poor manner in which much of MODx is presented.

              Don’t get me wrong, I love MODx, but the presentation, documentation, and explanation often reduces users to the level of frustration this OP is describing...

              Agreed 110 percent! grin

              I love Modx,
              however when it’s free, you pay for it, in frustration.
              And the greatest form of frustration is wasting time.
                Best regards,
                Mike

                MODx Revolution 2.0.7 and 2.0.8 powered by PHP 5.3.5 / Apache 2.2.17 / MySQL 5.0.7 on Shared hosting
                MS Vista and FF 3.6.15 / Many dot com web sites.
                Timezone: America/New_York
                • 23299
                • 1,161 Posts
                OK, one thing is really bugging me mw11. I know I have seen that photo you have in your avatar? I think it might even been on this forum? Or are you active on another forum I frequent?
                  • 3749
                  • 24,544 Posts
                  Quote from: Photowebmax at Feb 01, 2011, 10:40 PM

                  OK, one thing is really bugging me mw11. I know I have seen that photo you have in your avatar? I think it might even been on this forum? Or are you active on another forum I frequent?

                  I believe that’s a photo of actor Bruce Campbell. wink

                  http://www.imdb.com/name/nm0132257/
                    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
                    • 20725
                    • 32 Posts
                    Quote from: BobRay at Feb 01, 2011, 10:54 PM

                    Quote from: Photowebmax at Feb 01, 2011, 10:40 PM

                    OK, one thing is really bugging me mw11. I know I have seen that photo you have in your avatar? I think it might even been on this forum? Or are you active on another forum I frequent?

                    I believe that’s a photo of actor Bruce Campbell. wink

                    http://www.imdb.com/name/nm0132257/
                    Surely it is a photo of Bruce Campbell!

                    FYI, when and if you go to your "Forum Profile Information", you’re able to pick a picture. However, if you pick a picture (of Bruce Campbell), other forum members can also pick the very same picture. This can create a minor confusion and a bunch of questions.

                    You made a better choice. Because so far you’ve posted many times. You’ve been around. However, so far there’s no (real) portrait associated with your profile. No picture... no confusion... no questions... no distraction.

                    Maybe I, too, should take down the picture of Bruce Campbell.

                    But we’re digressing...
                      Best regards,
                      Mike

                      MODx Revolution 2.0.7 and 2.0.8 powered by PHP 5.3.5 / Apache 2.2.17 / MySQL 5.0.7 on Shared hosting
                      MS Vista and FF 3.6.15 / Many dot com web sites.
                      Timezone: America/New_York
                      • 20725
                      • 32 Posts
                      Frustration, and more frustration....

                      Let me explain...

                      In Modx Revolution, every resource/page has about 10 fields we need to or should fill out.

                      A. On each "resource" page there is a "MenuIndex" field with an ambiguous explanation.... what a minor uncertainity... I put ’3’s in these fields, in all of my (three) resource pages (so far), however I’m not sure it this was the right decision.
                      Where the "menu order" is:

                      There are 1 + 3 + 3 = 7 pages.
                      ..... 1 is the (menu order of the) main page
                      ..... the 2s are the (menu order of the) (three) secondary pages
                      ..... the 3s are the (menu order of the) (three additional) pages that are the children of one of the secondary pages.

                      B. On each "resource" page, also there is a "ParentResource" field with an ambiguous explanation.... what an additional uncertainity... I’m trying to put ’5’s in these fields in all of my (three) resources (so far), where ’5’ is the ID of one of my secondary pages, however Modx seems to be working against me, and working hard, and not allowing any number in those fields, except maybe ’0’s.... but zeroes can’t be correct! I GOT IT smiley I first have to set the order of parents and children - by dragging 6 of my 7 resources. This is a VERY necessary maneuver, yet I’ve yet to see it in Modx documents/help files!!!!

                      However, in spite of these improvements, still there is no output.
                      (except for the ***[[!getResources? &parents=`0`]]*** code that dumps to the screen a dizzying array with all resource fields.)
                      (OR for the ***[[!getResources? &parents=`1`]]*** code that dumps to the screen a dizzying array with all resource fields.)

                      Dumb it down for me, please!
                      WHAT am I doing wrong?

                        Best regards,
                        Mike

                        MODx Revolution 2.0.7 and 2.0.8 powered by PHP 5.3.5 / Apache 2.2.17 / MySQL 5.0.7 on Shared hosting
                        MS Vista and FF 3.6.15 / Many dot com web sites.
                        Timezone: America/New_York

                      This discussion is closed to further replies. Keep calm and carry on.