We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19369
    • 1,098 Posts
    Quote from: mojomateo at Apr 24, 2012, 01:59 PM
    from the parent ressource

    In a template, or inside a chunk?
      • 38723
      • 165 Posts
      Quote from: microcipcip at Apr 24, 2012, 02:08 PM
      Quote from: mojomateo at Apr 24, 2012, 01:59 PM
      from the parent ressource

      In a template, or inside a chunk?

      ^^this.

      Does the parent resource have it's own template or are you just calling the chunk from the parent resource's page content?

      Either way, I wouldn't call a chunk just to do a getResources call - just put the getResources call straight into the template or page content something like as follows:

      [[getResources? &parents=`2` &tpl=`thumbs_template` &showHidden`1` &includeTVs=`1` &processTVs=`1` &limit=`20`]]
      
        • 39267
        • 50 Posts
        hm sorry about my last post i made a mistake and forget the = by using
        &resources=`20,21,22`
        it works.

        So here is the way i do:

        I have a template called "PORTFOLIO"
        which I use for the ressource called "PORTFOLIO" (the ressource have the same name)
        Wich is a container of the ressources i want to display with getResources
        That ressource (PORTFOLIO) is the one I call the chunk:
        [[!getResources? &parents=`[[*id]]` &tpl=`thumbs_template` &depth=`2` &limit=`20` &showHidden`1` &includeTVs=`1` &processTVs=`1` &tvPrefix=``]]

          • 38723
          • 165 Posts
          If I've understood your post correctly you are calling the chunk "thumbs" from the content of the page resource called "portfolio"?

          So on the "portfolio" page, you are calling [[$thumbs]] directly as a chunk from the content of this page?

          If the page has it's own template, it would be simpler and easier to maintain in the long run if you just do the getResources call within the portfolio template. smiley
            • 39267
            • 50 Posts
            If I've understood your post correctly you are calling the chunk "thumbs" from the content of the page resource called "portfolio"?
            yes,

            i'm out of ideas -_-
            I have tried to make direct call from the ressources and templates
              • 38723
              • 165 Posts
              I also just noticed this in one of your chunks:

              [[+tv.Upload_thumbs]]
              


              but in your getResources call you included &tvPrefix=`` which will remove the tv. part from the template variables in the getResources call.

              Does the call output any HTML at all? Is this on a domain we can view?

              Can you paste the HTML for the template you are using at the moment as well?
                • 38723
                • 165 Posts
                Sorry, forums removed part of code from the previous post - it should have said:

                Quote from: pdincubus at Apr 24, 2012, 02:33 PM

                So on the "portfolio" page, you are calling
                [[$thumbs]]
                directly as a chunk from the content of this page?
                  • 39267
                  • 50 Posts
                  When I use
                  &resources=`20,21,22`
                  to see the output the tv is not showing but that's not important at the moment.
                  I just want the array to work.

                  here is an temporary url to se the result with
                  &resources=`20,21,22` (without there are no results)

                  http://www.massagedouceurdumonde.com/modx/index.php?id=2

                  I'm going to make screenshot to show you the way i did the calls.

                  And thanks for your help.
                    • 38723
                    • 165 Posts
                    Change

                    [[+tv.Upload_thumbs]]


                    to:
                    [[+Upload_thumbs]]


                    If you are going to keep &tvPrefix=`` in the getResources call smiley

                    Looks on the test page like the pagetitle, description, etc are working.
                      • 30912
                      • 463 Posts
                      Agreed, now it makes a bit more sense,

                      I'm working on something similar actually - an accordian, heres my info:

                      Template.

                      <div class="content-left">
                                <div class="content-area"> [[*content]] </div>
                                <div class="accordian">
                      
                      CALL GOES HERE
                      
                      </div>
                      
                              </div>


                      Call

                      [[!getResources? &parents=`[[*id]]` &tpl=`Accordian_Jobs` &includeContent=`1` &showHidden=`1` &sortby=`menuindex` &sortdir=`ASC` ]]


                      Chunk

                      <h2 class="acc_trigger"><a href="#">[[+pagetitle]]</a></h2>
                      <div style="display: block;" class="acc_container">
                        <div class="block">
                         [[+content]]
                        </div>
                      </div>


                      If i wanted to NEST a call, i would add it in the chunk as so:

                      <h2 class="acc_trigger"><a href="#">[[+pagetitle]]</a></h2>
                      <div style="display: block;" class="acc_container">
                        <div class="block">
                         [[+content]]
                      
                      [[!getResources? &parents=`[[*id]]` &tpl=`OTHER_TPL` &includeContent=`1` &showHidden=`1` &sortby=`menuindex` &sortdir=`ASC` ]]
                      
                        </div>
                      </div>


                      Note the change of &parents, by setting it as [[*id]] im saying look at the current page id im on

                      edit: pdincubus: good spot!