We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10076
    • 1,024 Posts
    Hi I am trying to generate content on a page with getresources.
    Content is generated but images do not show up.
    Here s the call
    [[!getResources? &parents=`14` &tpl=`ItemTpl` &showHidden=`1`&showUnpublished=`1`]]


    And the tpl chunk:
    <article class="text-item page featured clearfix" role="article">
    <header>
    <div class="text-item-picture">
    [[*textImage]]
    </div>
    <h4>[[+pagetitle]]</h4>
    </header>
    <section>
    <div  title="[[+pagetitle]]">
    [[+introtext]]
    <span class="label"><a href="[[~[[+id]]]]">lees verder</label></a>
    </div>
    </section>
    </article>


    Call is on the resource 14 and the images are pulled from the child pages. But they do not show? I can see all the rest, how can this be? [ed. note: franklos last edited this post 13 years, 7 months ago.]
      • 16702 ☆ A M B ☆
      • 536 Posts
      try eith this: &tvPrefix=`tv.` &processTVs=`1` &includeTVs=`1` in GR call

      [[!getResources? &parents=`14` &tpl=`ItemTpl` &showHidden=`1`&showUnpublished=`1` &tvPrefix=`tv.` &processTVs=`1` &includeTVs=`1`]]


      and in chunk: [[*tv.textImage]]



      Quote from: franklos at Mar 16, 2013, 05:08 AM
      Hi I am trying to generate content on a page with getresources.
      Content is generated but images do not show up.
      Here s the call
      [[!getResources? &parents=`14` &tpl=`ItemTpl` &showHidden=`1`&showUnpublished=`1`]]


      And the tpl chunk:
      <article class="text-item page featured clearfix" role="article">
      <header>
      <div class="text-item-picture">
      [[*textImage]]
      </div>
      <h4>[[+pagetitle]]</h4>
      </header>
      <section>
      <div title="[[+pagetitle]]">
      [[+introtext]]
      <span class="label"><a href="[[~[[+id]]]]">lees verder</a>
      </span></div>
      </section>
      </article>


      Call is on the resource 14 and the images are pulled from the child pages. But they do not show? I can see all the rest, how can this be?
        palma non sine pulvere
        • 10076
        • 1,024 Posts
        Hi and thanks, this is the source, notice the space where the image should be??

        <article class="text-item page featured clearfix" role="article">
        <header>
        <div class="text-item-picture">
         
        </div>
        <h4>Volle desktop</h4>
        </header>
        <section>
        <div title="Volle desktop">
        Wat veel mensen niet beseffen is dat hoe meer zaken er op je het scherm van je computer staan, hoe minder geheugen er overblijft voor het goed lopen van je computer. en hoe trager hij dan ook wordt!
        <span class="label"><a href="volle-desktop.html">lees verder</a>
        </span></div>
        </section>
        </article>
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          http://rtfm.modx.com/display/ADDON/getResources#getResources-DisplayingTemplateVariableswithgetResources

          Using [[*...]] means "from the current resource" and MODx will process it, that it, the resource with the getResources snippet in it; it would show the image belonging to this resource if it had one - in every listing summary. Try it with [[*pagetitle]] in your tpl to see what I mean. To get the TV from the resource that getResources is processing as part of its list, use [[+...]] and then getResources will process it.
            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
            • 10076
            • 1,024 Posts
            Thanks, that did the trick.

            [[+tv.textImage]]
            instead of
            [[*textImage]]
            [ed. note: franklos last edited this post 13 years, 7 months ago.]