We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46450
    • 8 Posts
    I'm having a bit of trouble figuring out the getResources functionality of MODX. My current objective is to make adding/editing some current entries on a website easier. If you click here ( http://senntenial.com/downloads ) and navigate to instruments, you'll see that I have lots of repeated items with slightly modified information like descriptions, etc. How would I do this?

    Currently, my setup is like this:
    I have a downloads page container and template that contains all of my basic HTML and the getResources call that looks like this:

    [[!getResources?
    &parent='0'
    &depth='1'
    &tpl='downloadTile'
    &includeContent='1'
    &includeTVs='1'
    &processTVs='1'
    &showHidden='1'
    &sortby='menuindex'
    &sortdir='ASC'
    ]]


    My &tpl is contained in the following chunk:

    <!--BLOCK TILE-->
    <a target="_blank" href="[[+tv.downloadLink]]"> 
      <div class="tile">
        <!--moreinfo-->
        <div class="bottom">
        <img class="download" src="[[+tv.downloadImage]]"/>
        </div> 
    
        <!--SC WIDGET-->
        [[+tv.downloadSC]]
    
        <!--title-->
        <div class="title">
        [[+tv.downloadTitle]]
        </div>
    
        <!--content-->
        <div class="content">
          [[+tv.downloadDescription]] 
        </div> 
      </div>
    </a>
    <!--END BLOCK TILE-->
    


    I've set up my template variables correctly, but I'm a bit stuck on how to implement the getResources call.

    If it helps, I also have screenshots of both my elements and resources file structure: http://puu.sh/6E1p0.png / http://puu.sh/6E1rT.png [ed. note: piedoom last edited this post 10 years, 1 month ago.]
      • 27376
      • 576 Posts
      Try setting
      parents=`4`
      Parents is plural. Also, you will probably need content in that container that isn't deleted.
        • 46450
        • 8 Posts
        Fixed the "parents" (And changed the ' to `)

        How exactly do I set up content in that container? My best guess was to create a template with a content set to the chunk I made, and then set that template to a document. That doesn't seem to work.

        EDIT:

        No longer needed, I found a great extension called MIGX that does all of this for me. [ed. note: piedoom last edited this post 10 years, 1 month ago.]
        • MIGx does just about anything wink And you might want to check out pdoTools; it is a fast, powerful library for listing and displaying stuff. It comes with a whole bunch of snippets, like pdoMenu (Wayfinder like Wayfinder should have been), pdoResources, pdoUsers...

          Between MGx and pdoTools, there isn't a whole lot you can't do. In fact, migxMultiLang uses pdoTools extensively for its easy-to-use multi-language management.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org