Search code examples
modxgetresource

getResources Modx return null?


I am trying to access some TV from another resource using getResources, but nothing is returned.

Here is my code sample

 [[getResources? 
      &resources=`13` 
      &tvPrefix=`tv.` 
      &tpl=`@CODE:[[+tv.DefaultEmail]]` 
      &showHidden=`1` 
      &includeContent=`1` 
      &includeTVs=`1` 
      &processTVs=`1` 
 ]]

Solution

  • You have to use @INLINE for the template parameter (see @FILE and @INLINE tpls in https://rtfm.modx.com/extras/revo/getresources#getResources-TemplatingProperties)

    &tpl=`@INLINE [[+tv.DefaultEmail]]`
    

    But I would better install FastField to use the following tag syntax [[#13.DefaultEmail]].