0

I am trying to use getResource to pull a few resources into a single page, then these resources link through to a detailed information page of the specified resource.

[[getResources? &tpl=`profile-ditto` &limit=`all` &parents=`18` &sortby=`publishedon` &hideContainers=`1` &includeContent=`1` &includeTVs=`1` &processTVs=`1`]]

This pulls all the content and sorts it into the correct order, however I need it to load a specific resource depending on which link was clicked on.

List of my Modx resources

This is my resource list that I am pulling, so the page I am loading them all to is People (18) and I each of the children have more detailed pages which I need to load individually depending on which link people click on the page. So is it possible to load a certain resource from a getResource call?

josh
  • 15
  • 6
  • It's not very clear what you're asking. Can you add an example of what you're currently getting (ie. list the resources as they are currently being sorted), and then indicate how you want them ordered instead? – okyanet Jun 11 '14 at 03:01

1 Answers1

0

So after investigating getResource a little more on there information page Link to getResource I figured out that with what is available to getResource wouldn't solve my problem.

I decided to write a custom snippet that uses the id of the resource and then loads that resource when clicked while still using the getResource to save time on adding content.

            <div class="one-fifth column people-height">

            <div class="people-info">

                <div class="table">

                    <a href="[[~[[+id]]]]?id=[[+id]]"><img class="scale-with-grid" src="[[+tv.people-img]]" alt="[[*pagetitle]]"/></a>
                    <p><strong>[[+pagetitle]]</strong></p><p>[[+introtext]]</p>

                </div>

            </div>

        </div>

I added ?id=[[+id]] to the anchor tag so that the URL had the resources id in it, I then created a snippet which loaded the correct resource to match the id in the URL. I believe this to be the easiest way to load specific resources from a getResource call on Modx Revo at the current time of posting. I will find a good place to store the snippet so people looking for something similar will be able to get there hands on it.

josh
  • 15
  • 6