0

I am trying to use getResources to display multiple resources withing one resource, including their Templates and TVs.

The code I have in the page I want to display them is:

[[!getResources? &parents=`50` &sortdir=`ASC` &sortby=`menuindex` &limit=`100` &includeTVs=`1` &processTVs=`1` &tpl=`gigtemp` ]]

Where &tpl=gigtemp is a chunk I have created where all my template HTML and TVs are.

However, nothing is showing on the page.

Can anyone help me out?

Please let me know if I need to explain more.

Update:

Some of the info is showing, but a lot of the html is broken.

My HTML on the Chunk is:

<div class="gig-guide">
<div class="gig-info">
<h2>[[+tv.gigname]]</h2>
<strong>[[=tv.gigcity]]</strong>
<img src="[[+tv.gigthumb]]" alt="Contra Clave Contra Event: [[+tv.gigname]" /></div>
<div class="gig-info">
<h2>[[+tv.gigdate]]</h2>
[[+tv.gigtime]]</div>
<div class="gig-info">
<h2>[[+tv.gigvenue]]</h2>
[[+tv.gigaddress]]</div>
<div class="gig-info">
<h2>[[+tv.gigcost]]</h2>
</div>
<div class="gig-bottom">
<div class="fb-like" data-href="[[+tv.gigfbevent]]" data-send="false" data-width="300" data-colorscheme="dark" data-show-faces="false"> </div>
<div class="gigsocialmedia"><a href="[[+tv.gigbandfb]]" target="_blank"><img src="assets/images/ccc-fb.png" alt="This event on Facebook" /></a> <a class="twitter-share-button" href="https://twitter.com/share?text=[[+tv.gigtwitter]]" target="_blank" data-lang="en"><img src="assets/images/ccc-twiter.png" alt="Tweet this event" /></a> <a href="mailto:?subject=[[+tv.gigemail]]"><img src="assets/images/ccc-email.png" alt="Email this event to a friend" /></a></div>
</div>
<!--END GIG BOTTOM DIV-->
<!--END GIG GUIDE DIV-->

Again, any help is appreciated!

MeltingDog
  • 14,310
  • 43
  • 165
  • 295

2 Answers2

1

Your code is valid and as far as I can see, without errors. That means that there is something else wrong, I would guess one of the following:

  • You have not cleared your cache, which is not necessary but could solve weird problems
  • The children of resource 50 is not published or is hidden
  • There is something else wrong around your code, making Modx not parsing it correctly.

Edit: You had several errors in your chunk. Try replacing it with this:

<div class="gig-guide">
<div class="gig-info">
<h2>[[+tv.gigname]]</h2>
<strong>[[+tv.gigcity]]</strong>
<img src="[[+tv.gigthumb]]" alt="Contra Clave Contra Event: [[+tv.gigname]]" /></div>
<div class="gig-info">
<h2>[[+tv.gigdate]]</h2>
[[+tv.gigtime]]</div>
<div class="gig-info">
<h2>[[+tv.gigvenue]]</h2>
[[+tv.gigaddress]]</div>
<div class="gig-info">
<h2>[[+tv.gigcost]]</h2>
</div>
<div class="gig-bottom">
<div class="fb-like" data-href="[[+tv.gigfbevent]]" data-send="false" data-width="300" data-colorscheme="dark" data-show-faces="false"> </div>
<div class="gigsocialmedia"><a href="[[+tv.gigbandfb]]" target="_blank"><img src="assets/images/ccc-fb.png" alt="This event on Facebook" /></a> <a class="twitter-share-button" href="https://twitter.com/share?text=[[+tv.gigtwitter]]" target="_blank" data-lang="en"><img src="assets/images/ccc-twiter.png" alt="Tweet this event" /></a> <a href="mailto:?subject=[[+tv.gigemail]]"><img src="assets/images/ccc-email.png" alt="Email this event to a friend" /></a></div>
</div>
<!--END GIG BOTTOM DIV-->
<!--END GIG GUIDE DIV-->
OptimusCrime
  • 14,662
  • 13
  • 58
  • 96
1

Are your resources you are trying to display hidden? then you need the &showHidden=1 .

Are they unpublished? then you also need the &showUnpublished=1

You may also need the &includeContent=1 ~maybe~

See if you can get away without using the &processTVs

If you are still having issues - leave out the &tpl=``, getResources will just dump it's output to the page so you can see what is actually being returned. Might give you another clue as to what is not happening..

Sean Kimball
  • 4,506
  • 9
  • 42
  • 73