We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12372
    • 44 Posts
    Hello,

    I have decided to take the plunge and convert Evo to Revo, as I’m relaunching my website.

    I am using GetResources intead of Ditto, and am creating the tpl chunk to recreate lists of links etc.

    However, how do I put a template variable value into that chunk?

    I thought, upon reading, that it was: [[+casestudy-logo]] but also tried [[*casestudy-logo]] - neither generate a result.

    Thanks
      • 32098
      • 31 Posts
      From what I know (which is admittedly little) your first attempt at TV insertion was correct. Compare my chunk (where +filename is a TV):

      <div><img class="ss" src="[[+filename]]" alt="[[+filename]]" /></div>


      If your TVs are not showing it might be because the snippet is not calling them correctly. If you are using getResources you have to disable its automatic prefixing of TVs. In the snippet call you need:

      &includeTVs=`1` &processTVs=`1` &tvPrefix=``


      When writing your own snippet, and you have to get the TVs for a resource you need to include something like this:

      $listoutput .= $modx->runSnippet('getResources', array('resources' => $value, 'tpl' => 'villalistchunk', 'includeTVs'=>'1', 'tvPrefix'=>'', 'processTVs'=>'1', 'sortby'=>'RAND()' ));


      Good luck.
        • 12372
        • 44 Posts
        &includeTVs=`1` &processTVs=`1` &tvPrefix=`` worked a charm!

        Many thanks!