We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42535
    • 52 Posts
    I'm using a chunk to create an output template for a getResources call. I need to be able to display the page-specific values of template variables, but it will only display the default values.

    How do I get the page-specific (rendered) value for a TV on a page? I don't want to put my information into the existing fields (like longtitle, introtext, etc.), I want them in custom TVs. But, it seems that the TV is only queried when the page is rendered (which I am not doing).

    I'm building an output table with details about objects that are not viewable directly. My template chunk looks like this:

    </tr>
    <tr>
    <td>[[+pagetitle]]</td>
    <td>[[+longtitle]]</td>
    <td>[[*TV1]]</td>
    <td>[[*TV2]]</td>
    <td>[[*TV3]]</td>
      • 42535
      • 52 Posts
      Never mind. I figured it out.

      You have to modify the getResources call to include TVs, process the TVs, and define a prefix that will be used.

      [[getResources? &parents=`219` &tpl=`outputTpl` &limit=`0` &sortby=`-menuindex` &showHidden=`1` &includeTVs=`1` &processTVs=`1` &tvPrefix=``]]


      Then, in the chunk, you change the default method of calling TVs ([[*TVname]]) to calling a placeholder instead ([[+TVname]]).

      That's it.
        • 35715
        • 59 Posts
        GetResourceField can also be useful in certain scenarios...

        http://rtfm.modx.com/extras/revo/getresourcefield