We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42560
    • 49 Posts
    Hi, how can i access the param send from a chunk and use it inside a it, using getresources

    have the *idRelacionados checking for existing ids from a TPLVAR(idRelacionados)

    
    [[*idRelacionados:is=``:then=``:else=`[[$Rel-Medicinas? &idRelacionados=`[[*idRelacionados]]`]]` ]]
    
    


    if exist, i call the chunk and pass it the ids

    [[+idRelacionados]]   <!--This is fine, just a list of id-->
    
    	  <ul class="ID-Rel-Med">
    	  	[[!getResources? &parents=`-1` &resources=`[[+idRelacionados]]` &tpl=`@INLINE <li><a href="[[+uri]]">[[+pagetitle]]</a></li>` &depth=`1` &sortdir=`ASC` &limit=`6`]]
    	  </ul>
    


    i was expecting to see the &resources filled with the ids, since [[+idRelacionados]] is fine until this line of comment, but it doesnt work when i call if from getresources, do i need to change the INLINE for a tpl chunk?

    thanks

    This question has been answered by Bruno17. See the first response.

    • discuss.answer
      • 4172
      • 5,888 Posts
      you don't need this chunk-construct at all.
      try to call in like that in your template:

      [[getResources? 
          &parents=`-1` 
          &resources=`[[*idRelacionados]]` 
          &tpl=`@INLINE <li><a href="[[+uri]]">[[+pagetitle]]</a></li>` 
          &depth=`1` 
          &sortdir=`ASC` 
          &limit=`6`
          &tplWrapper=`wrapperTpl`
      ]]
      

      in your wrapperTpl have:

      <ul class="ID-Rel-Med">
      [[+output]]
      <ul>


      And I don't see, why you would need it uncached. So I called it cached.

        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 42560
        • 49 Posts
        Quote from: Bruno17 at Dec 15, 2017, 04:41 PM
        you don't need this chunk-construct at all.
        try to call in like that in your template:

        [[getResources? 
            &parents=`-1` 
            &resources=`[[*idRelacionados]]` 
            &tpl=`@INLINE <li><a href="[[+uri]]">[[+pagetitle]]</a></li>` 
            &depth=`1` 
            &sortdir=`ASC` 
            &limit=`6`
            &tplWrapper=`wrapperTpl`
        ]]
        

        in your wrapperTpl have:

        <ul class="ID-Rel-Med">
        [[+output]]
        <ul>


        And I don't see, why you would need it uncached. So I called it cached.

        </ul></ul>

        Thank you so much, it works. i havent used [[+output]] before XD