We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43010
    • 7 Posts
    I'm trying to use tplWrapper but I can't get it working (it doesn't list anything but the tplWrapper).

    This is my tpl:
    <li><a href="[[~[[*id]]]]#[[+alias]]">[[+pagetitle]]</a></li>


    This is my tplWrapper:
    <ul id="jobList"></ul>


    I suppose I should place something inside the #jobList ul tag but I don't know what. Could you please help me out?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I suspect you'll need to use the &toPlaceholder=`myplaceholder` property, then add the [[+myplaceholder]] placeholder in your tplWrapper.
        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
        • 43010
        • 7 Posts
        Thanks for your quick reply Susan. I've already tried it though and it doesn't seem to work. Moreover, placing the placeholder inside the tplWrapper breaks the getResources call as it doesn't return anything at all.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Are you sure you have the latest version (1.6.0) with the feature?
            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
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Hm. Tried it out, and it definitely doesn't seem to work as expected. Can't find any documentation on how it should be used, either. Jason?
              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
              • 6228
              • 249 Posts
              This should do the trick:

              <ul id="jobList">[[+output]]</ul>
                lo9on.com

                MODx Evolution/Revolution | Remote Desktop Training | Development
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Yep, that does the job. For some reason I had thought the wrapper placeholder should be [[+result]].

                Snippet call:
                [[getResources? &tpl=`listTpl` &tplWrapper=`wrapperTpl`]]
                  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
                  • 7222
                  • 20 Posts
                  I'm having a simliar problem. Here is my getResources call:

                  [[getResources?
                  	&parents=`27`
                  	&limit=`99`
                  	&depth=`1`
                  	&sortdir=`ASC`
                  	&includeTVs=`1`
                  	$toPlaceholder=`output`
                  	&tplPath=`[[++assets_path]]/tpl/chunks/`
                  	&tplWrapper=`@FILE grWrapperSpeakersGrid.tpl`
                  	&tpl=`@FILE grSpeakersGrid.tpl`
                  ]]
                  


                  my `grWrapperSpeakersGrid.tpl` looks like this:

                  <ul class="multi-list four-cols">
                  	[[+output]]
                  </ul>
                  


                  This just churns out an ugly array.

                  I'm having to use the old `[[out:notempty=...` trick, which is fine - but seeing as though I'm on v1.6 using tplWrapper just seems 'nicer'. Any pointers?
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    It puts out the array if it can't find your tpl.
                      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